Joining 2 DataTables from a DataSet

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

Hallo everybody,

I have a DataSet contains two DataTables with a relationship between them.
Now I want to populate a DadaGrid (windows from) with the inner join of
those table . I thought about something like bounding some cells in every
row and then catching the event ItemDataBound to get the parent row using
the proper relationship and populate the rest cells with the retrieved
information . Unfortunately the Windows-forms version of DataGrid doesn't
expose such an event .
So what can I do other that requering the database to get the join of those
tables

Thanks in advance
 
Chris,
Have you looked into using the JoinView VB.NET sample custom DataView from
MSDN?

It allows you to create a JoinView, which is similar to a DataView, that
returns data from two DataTables as a single view.

See:
http://support.microsoft.com/default.aspx?scid=kb;en-us;325682

Basically you create a new JoinView object, set the properties for your
join, then use this JoinView object as the DataSource on your DataGrid.

Hope this helps
Jay
 
Thanks alot

I have only to check out how changing some fields of this JoinView will
affect my original DataTable, but seems to be exactly what I need.
 
Back
Top