views:

1141

answers:

1

I have created three data tables by pulling data from an sql database. DT1, DT2, DT3. I have added these three tables to a data set, myDS. I have added relations between these three tables. I then dragged a DataGridView onto my form and I want to bind the three tables to the DataGridview. So I added my dataset DS to a dataview manager, myDVM. I bound myDVM to a bindingsource, bindingSource1, and made it the data source for the DataGridView. I am not sure how to bind the tables I want from myDVM / bindingSource1, to appear in the DataGridView.
i want to display the child tables related to the parent table using primary key in the same datagridview!!

thanks in advance!!!

help me plz!!!

A: 

If by "display the child tables" you mean display related data from child tables, you should SELECT your data into a single table using the appropriate joins. DataGridViews display their data in a single-table format - there is no "multiple table" concept in a DataGridView.

DataSet.Merge() can help you to merge DataRows from separate objects into one.

Andy West
can we append these three tables using merge() ?bcoz, these tables may contain different columnname... how that will work??? explain with an example!thanks for ur quick response, andy!
Lijo
Did you visit the link? If you do, you will see that there is an overload that handles incompatible schemas.
Andy West
Examples can be found here: http://msdn.microsoft.com/en-us/library/aszytsd8.aspx
Andy West