databind combo box to text box

revkev

New member
Joined
Aug 31, 2007
Messages
1
Programming Experience
1-3
hello...
Probably a simple question but I have to ask...

I have two tables one with last name and basic info, one with detailed info. Both set up with Primary key and Foreign key.

I have a combo box that displays the last names and then by clicking the last name, text boxes fill with the "other" data from table1,
however,
there are some text boxes that I would like to fill with data from the table2.
Any pointers??
 
bind them to the bindingsource bound to the datatable on the child side of the relationship, ensure that the datarelation between the parent and child datatables in the form's dataset instance is present and active, and fill the child table using the id of the current row of the parent bindingsource as a parameter to the FillByX method you created on the child tableadapter (it targets the foreign key column)

If none of that makes sense, read the DW2 link in my signature, section on Creating a Simple Data Application - it features relations. Read also Creating a Form to Search Data so you know how to create the FillByX method, and the sections on Displaying Related Data may help further
 
Back
Top