1,105,633 Community Members

different itemsource for a combobox than the bound datasource

Member Avatar
ttitto79
Newbie Poster
2 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

What method did you use to databind the combobox?

Member Avatar
ttitto79
Newbie Poster
2 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
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.

Attachments combobox_properties.JPG 149.6KB
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: