I think
this article[
^] might help you. It's part of a
set of articles[
^]. And that too is part of
more articles[
^].
An excerpt from the first article:
If your dataset contains multiple tables, you have to update them individually by calling the Update method of each data adapter separately. If the tables have a parent-child relationship, it is likely that you will have to send updates to the database in a particular order. A common scenario is that you have added both parent and related child records to a dataset — for example, a new customer record and one or more related order records. If the database itself is enforcing relational integrity rules, it will raise errors if you send the new child records to the database before the parent record has been created.
Conversely, if you delete related records in the dataset, you generally have to send updates in the reverse order: child table first, then parent table. Otherwise, the database is likely to raise an error because referential integrity rules will prevent you from deleting a parent record while related child records still exist.
A general rule for sending updates for related tables is to follow this order:
Child table: delete records.
Parent table: insert, update, and delete records.
Child table: insert and update records.
Hope it helps :)