We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,644 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

different itemsource for a combobox than the bound datasource

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

2
Contributors
2
Replies
1 Day
Discussion Span
6 Months Ago
Last Updated
3
Views
ttitto79
Newbie Poster
2 posts since Dec 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

What method did you use to databind the combobox?

john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25
Solved Threads: 22
Skill Endorsements: 3
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
ttitto79
Newbie Poster
2 posts since Dec 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0779 seconds using 2.66MB