|
-
Jan 19th, 2004, 08:45 PM
#1
Thread Starter
Addicted Member
[Resolved] SQL Relationships
Ok guys,
I'm sure there is an easy solution to this but I can't seem to find it.
Basically I am working with a large number of tables in a database with parent-child type relationships. (Enforced in both the Sql Database and the the datasets relationships)
For example
ParentTable
-ParentID
-ParentValue1
-ParentValue2
....
ChildTable
-ChildID
-ParentID
-ChildValue1
-ChildValue2
...
Now to insert isn't a problem, use a dataadapter on ParentTable and then on ChildTable. To delete you need to do it the other way round, ChildTable and then ParentTable. (As you cannot delete from ParentTable first due to childtable having a reference to one of it's rows.)
The problem is that there are alot more than 2 datatables in this relationship, also a datatable may have rows that are required to be added and deleted from it when an update is performed.
I have tried setting the SqlDatabase relationships to cascade deletions but .Net rightfully complains about a concurrency violation when it gets to a row that has already been deleted by Sql.
Any ideas on a clean way of resolving this?
Last edited by Carnifex; Jan 21st, 2004 at 05:43 AM.
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
|