> Hi,
> I've been searching quite a lot and can't find any answer.
[quoted text clipped - 19 lines]
> I have been searching and can't do this thing. I thought it would be
> easier but I'm stuck with this. Any help will be appreciated.
Step 1: put both tables in the same dataset, if they are not already.
Step 2: define a Relation in that dataset, linking the two tables by idMaster.
Step 3: add a column to the Details table, with an expression displaying a field
from the parent table.
Step 4: add a column to your grid to display that field.
So if you start with
Dim Master As DataTable
Dim Details As DataTable
you can then do
Dim MyDataSet As New DataSet
MyDataSet.Tables.Add Master
MyDataSet.Tables.Add Detail
MyDataSet.Relations.Add( _
New DataRelation("MasterToDetail", _
Master.Columns("idMaster"), _
Details.Columns("idMaster")))
Details.Columns.Add( _
New DataColumn("MasterName", _
GetType(String), _
"Parent(MasterToDetail).masterName"))
Voila. You can now display the MasterName column of the Details table.
Jordi Rico - 08 Mar 2008 19:41 GMT
Thanks,
I'll give a try when I go back to the office.