Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more: , +
Hello,
I have an sql server 2008 database with 2 tables, a master (Table_1) and a detail (Table_2). I have created an application (windows forms) in vb .net 2008, I used ado (sqldataadapter, sqlconnection, dataset), 1st adapter (sqldatadapter1) added the master table and second adapter (sqldatadapter2) added the detail. I have right click in the adapters and generated the same dataset (dataset1). I opened the dataset1 (double click) and view the 2 tables, I dragged from the master pk to the detail fk the mouse and created the relationship (sorry for the long description). In the detail I have an image field so I cannot make a master/detail datagrid, I have to have seperated textboxes for the master and a picturebox for the detail. My problem is when I move to the next record of the detail
VB
Me.BindingContext(DataSet21, "Table_2").Position = (Me.BindingContext(DataSet21, "Table_2").Position + 1)

I move to the next id of the master, I want to move to the next detail record of the same master record, how can I do that programmatically? or do I have to write an sql select command string with an INNER JOIN?

Thank you
Kyriakos
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900