|
-
Mar 2nd, 2006, 06:27 AM
#1
Thread Starter
Fanatic Member
[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.
???? 
/Edit: I've tried doing drChild.SetParentRow(drParent , relParentChild) but it doesn't work.
Last edited by simonm; Mar 2nd, 2006 at 08:26 AM.
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Mar 2nd, 2006, 08:28 AM
#2
Thread Starter
Fanatic Member
Re: [RESOLVED] ADO.NET - Related DataTables
Doh!
I forgot to attach my new rows. Once I did that, everything was fine...
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|