Creating DataSet Relationships

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?
 
M

MRW

Found it!

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

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

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

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,224
Latest member
BettieToom

Latest Threads

Top