I am trying to use a combobox in a windows form for windows CE mobile device with sql server compact installed. I am using visual studio 2008.
I have two sdf databases - MobileArticles.sdf and MobileOrders.sdf
MobileArticles.sdf has a table Articles(name, weight,barcode,...) and a table Clients(ClientID)
MobileOrders.sdf has only one table Orders (OrderID, ClientID, name, weight, barcode, amount,...)
MyForm has textboxes for all the fields of the Orders table except for ClienID, which is a combobox.

I can not bind the combobox so that it shows the values from the MobileArticles.sdf->Clients->ClientID field and in the same time to Insert the ClientId in the MobileOrders.sdf ->Orders with the new record.

I suppose the answer is very simple but i couldn't find it. Please Help

Recommended Answers

All 2 Replies

What method did you use to databind the combobox?

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'GrivasMobileArticlesDataSet.Clients' table. You can move, or remove it, as needed.
        Me.ClientsTableAdapter.Fill(Me.GrivasMobileArticlesDataSet.Clients)
        'TODO: This line of code loads data into the 'GrivasMobileOrdersDataSet.orders' table. You can move, or remove it, as needed.
        Me.OrdersTableAdapter.Fill(Me.GrivasMobileOrdersDataSet.orders)
        Me.OrdersBindingSource.AddNew()

    End Sub

This is the loading sub for the form that contains the combobox.
Attached is a picture with the properties of the combobox.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.