[RESOLVED] ADO.NET - Related DataTables
I have a dataset with two data tables and a data relation.
When I fill these tables using a DataAdapter from existing data in the database, I can successfully navigate from a row in my parent table down to the rows in my child table like so:
VB Code:
drParent.GetChildRows(relParentChild)
Where drParent is my ParentDataRow and relParentChild is my DataRelation.
However, when I want to add a new record in each table (that relate to each other) like so:
VB Code:
drParent = dtParent.NewRow()
drParent.Item("ID") = "TEST Parent"
drChild= dtChild.NewRow()
drChild.Item("ID") = "TEST Child"
drChild.Item("ParentID") = "TEST Parent"
I then try to get to my child rows like so drParent.GetChildRows(relParentChild) but get no rows returned.
???? :sick:
/Edit: I've tried doing drChild.SetParentRow(drParent , relParentChild) but it doesn't work.
Re: [RESOLVED] ADO.NET - Related DataTables
Doh! :o
I forgot to attach my new rows. Once I did that, everything was fine...