Creating DataSet Relationships

  • Thread starter Thread starter MRW
  • Start date Start date
M

MRW

Hello!

I'm trying to create a dataset with a relationship inside a class, so
it can be used on multiple pages.

If I create the dataset in the class and define the relationship in the
page, it works perfectly. If I create the relationship in the class
itself, it doesn't work.

The only thing I can think of is that on the page I declare the
relationship even though it's declared in the class, so I can use it in
the code of that page, for example:

Dim userRelation As DataRelation

....
For Each rowRecord As DataRow In rowUser.GetChildRows(userRelation)
....

Any ideas?
 
Found it!

In case anybody is looking for it you need to define the relationship
as:

Dim userRelation As DataRelation = dsDT.Relations.Item("userRelation")
 
Back
Top