likhtin
Programmer
- Mar 31, 2006
- 8
Hi all
I have form and three DataGridView on it. They are binded to DataTable's which has relation as Parent-Children-Grandchildren, tables on MSQ SQl server has same relations.
To save changes which user makes in that objects I use method Update() of respective tableadapters. I call methods in respective sequence Parent,Children, Grandchildren
If user add record to Parent and Children and then saves changes everything works fine. But if he added records into all three objects and saves changes he gets error message that record in Grandchildren violate foreign key to Children table. Message generated by MS SQL server.
I can not understand reason for it. On a moment of updating of Grandchildren table, respective records already commited to Children table..
Any thoughts?
Info toward:
Adapters do update through store procedures., all tables involved have identity fields.
I have form and three DataGridView on it. They are binded to DataTable's which has relation as Parent-Children-Grandchildren, tables on MSQ SQl server has same relations.
To save changes which user makes in that objects I use method Update() of respective tableadapters. I call methods in respective sequence Parent,Children, Grandchildren
If user add record to Parent and Children and then saves changes everything works fine. But if he added records into all three objects and saves changes he gets error message that record in Grandchildren violate foreign key to Children table. Message generated by MS SQL server.
I can not understand reason for it. On a moment of updating of Grandchildren table, respective records already commited to Children table..
Any thoughts?
Info toward:
Adapters do update through store procedures., all tables involved have identity fields.