Syntax for using data relations
Posted on 2006-04-03
I've got a data set with two tables and a one to many relationship between them, all generated in the VS2005 Dataset designer. In the vb code, I can access the tables and their adapters fine.
I'd like to get the child rows associated with a parent row, and then total values in the child row. But first thing first, just get the collection of child rows.
In my newbie-ness, I got as far as this:
Dim wrkRows As DataRowCollection
wrkRows = wrkTable.FindByID(wrkID).GetChildRows( <-- asks for name of datarelation here
but I don't know how to call up the name of the data relation that apparently is supposed to go into the parameters for the .GetChildRows method. It doesn't seem to come up through intellisense if I type in the name of the dataset there.
Am I supposed to type the name in without the intellisense? Is the name in the intellisense for the dataset, but under another variable? Should it be there, and because it's not it indicates I've not completed the relation properly? Am I approaching this whole thing incorrectly?
Any guidance on this would be appreciated.