Datatable question!!!

albertkhor

Well-known member
Joined
Jan 12, 2006
Messages
150
Programming Experience
Beginner
1) is that possible to let two datatable join to become one? or
2) can two datatable bind in one dataggrid?
if yes, how to do that?
 
Last edited:
If you want to combine the data from two tables then you should perform a join in your SQL query. If you want to show a parent/child relationship between two tables you can do that in a DataGrid.

1. Get your data into two DataTables in the same DataSet.
2. Create a DataRelation between the two tables and Add it to the DataSet's Relations collection.
3. Assign the DataSet to the DataGrid's DataSource property and the name of the parent table to the DataMember property.

You will now be able to navigate the relationship in the DataGrid.
 
Back
Top