Data Relation Question

D

Declan

Is it possible to setup a datarelation for more than one level of
relationship?

i.e.

Grandfather
Father
Son

In other words I have a Master table (Grandfather). Each entry in the
master table can have multiple entries in its related table (Father).

Each entry in the Father table can have multiple related entrie in its
related table (Son)



' Add relation between Grandfather and Father
Dim rel1 As New DataRelation("DeedsNames", _
oDataSet.ReturnedDataSet.Tables("Deeds").Columns("ID"), _
oDataSet.ReturnedDataSet.Tables("NamedParties").Columns("DeedsID"))
oDataSet.ReturnedDataSet.Relations.Add(rel1)

' Add relation between Father and Son
Dim rel2 As New DataRelation("NamedPartiesRegister", _
oDataSet.ReturnedDataSet.Tables("NamedParties").Columns("ID"), _

oDataSet.ReturnedDataSet.Tables("NamedPartiesEvents").Columns("RelationID"))
oDataSet.ReturnedDataSet.Relations.Add(rel2)


These tables will be displayed in a grid. If the first GrandFather row is
selected the Father grid should show related items and similar for Father
and Son grids.

-dw
 
M

Miha Markic

Hi Declan,

You might add a relation between gf and son directly, supposing son holds a
pk of grandfather...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top