J
Jon the Blind
I feel like I must be missing something here. I'm using SQL Server 2000 and
ADO.NET. I have 2 tables, a master and a detail table with the usual
relationship. Cascade deletions are disabled by design (though I realize
enabling them would solve this issue).
Now, in a DataSet, say I create some records in the master and detail tables
and delete some in both tables as well.
If I update the master table first I violate the foreign key relationship
because it orphans rows in the detail table. If I update the detail table
first, I'm violating the same relationship because the parent rows haven't
been created in the DB yet.
Is there a way in ADO.NET to submit these updates all at once before the
database checks the constraints, something equivalent to the DataSet's
EnableConstraints functionality? (In other words, can I update each table
only once, or do I have to submit the master inserts, then update the detail
table, then submit the master table deletions?)
Any help is appreciated.
Regards,
Jon
ADO.NET. I have 2 tables, a master and a detail table with the usual
relationship. Cascade deletions are disabled by design (though I realize
enabling them would solve this issue).
Now, in a DataSet, say I create some records in the master and detail tables
and delete some in both tables as well.
If I update the master table first I violate the foreign key relationship
because it orphans rows in the detail table. If I update the detail table
first, I'm violating the same relationship because the parent rows haven't
been created in the DB yet.
Is there a way in ADO.NET to submit these updates all at once before the
database checks the constraints, something equivalent to the DataSet's
EnableConstraints functionality? (In other words, can I update each table
only once, or do I have to submit the master inserts, then update the detail
table, then submit the master table deletions?)
Any help is appreciated.
Regards,
Jon