Custom View/Table

badbee

New member
Joined
Feb 21, 2006
Messages
2
Programming Experience
1-3
Greetings!
I have two data tables in a dataset. Both the datasets contain some data which was obtained from multiple databases.
I have joined the tables via a DataRelation. Now I want to display the data in a DataGrid.
What I want to do is to display the data in columns (not hierarchy).
Both the tables have 1-1 relationship.
For Example,
DT1 contains (ID1, Name,Address),
DT2 contains(ID2,....)
I have joined ID1 and ID2
Now I want to create a view or some other mechanism so that it contains
Complete data from DT1 and DT2 based upon the relationship (similar to the results that we obtain by using a JOIN Statement in SQL).

I need the code or some general directions to accomplish this task. I don't need to use SQL to fetch the desired data.

Cheers!
 
There is nothing in the .NET Framework to do this for you. You could write code to create a new DataTable containing all the data without much trouble. You just create a DataTable, add the columns based on what the the existing DataTables contain, then start adding the rows. You would use the DataRelation to get the child row that corresponds to each parent row and then add the data from each to a single row in the new table.

As an alternative, you may be able to use this, but I've never used it myself so I'm not sure what its capabilities are.
 
Back
Top