T
TheNortonZ
I have a dataset with several tables in it. Some of the tables are related,
such as like where I would have an 'Order' parent table and an 'Order
Details' child table. The 'Order Details' also has a child table to it named
'Order Years' table. 'Order Details' has a foreign key of the primary key in
the Order table. The primary key in the Orders table is a guid.
'Order Years' has a foreign key to the 'Order Details' table. The primary
key of the 'Order Details' table is a guid.
I have made sure in my code, when I delete an order, I delete all associated
order details and then I have an inner loop that deletes all associated
order years data. Then I send the dataset to be saved to the database.
I do not have any data relationships setup in the dataset for these tables.
When I got to add/update/delete data in these sets, I create a data adapter,
set the select, update, insert etc commands to stored procedure calls and
then call .Update on that individual table.
In the code, I call update on the parent table, then on the child table that
has the foriegn key.
It seems that no matter which order I set these updates in, when I call the
child 'years' Update, I get a concurrency violation for the delete command.
Does it matter what order these updates are called in?
Thanks.
Norton
such as like where I would have an 'Order' parent table and an 'Order
Details' child table. The 'Order Details' also has a child table to it named
'Order Years' table. 'Order Details' has a foreign key of the primary key in
the Order table. The primary key in the Orders table is a guid.
'Order Years' has a foreign key to the 'Order Details' table. The primary
key of the 'Order Details' table is a guid.
I have made sure in my code, when I delete an order, I delete all associated
order details and then I have an inner loop that deletes all associated
order years data. Then I send the dataset to be saved to the database.
I do not have any data relationships setup in the dataset for these tables.
When I got to add/update/delete data in these sets, I create a data adapter,
set the select, update, insert etc commands to stored procedure calls and
then call .Update on that individual table.
In the code, I call update on the parent table, then on the child table that
has the foriegn key.
It seems that no matter which order I set these updates in, when I call the
child 'years' Update, I get a concurrency violation for the delete command.
Does it matter what order these updates are called in?
Thanks.
Norton