G
Guest
I have a form with master/child tables. I Deleted a row in the child table
with datarow.Delete and tried to save the change to the database. Because I
have a Foreign Key constraint between the tables I must make updates in a
certain order
1. Child Deletes
2. Master Updates/Deletes/Inserts
3. Child Updates/Inserts
When I try to Save the Child Deletes to the database via the dataadapter i
get the following error:
InvalidOperationException:
The Collection has changed
in swedish: Mängden har ändrats. Det är inte säkert att uppräkningen kan
genomföras.
vid System.Data.RBTree`1.RBTreeEnumerator.MoveNext()
Det finns ingen rad på positionen 0.
I tried a for each datarow in datatable loop and the exception is thrown at
the next command after the first datarow is saved.
It seems that you can't move to the next row in the collection after the
deleted row is saved to the database.
Does anybody have a workaround for this problem?
with datarow.Delete and tried to save the change to the database. Because I
have a Foreign Key constraint between the tables I must make updates in a
certain order
1. Child Deletes
2. Master Updates/Deletes/Inserts
3. Child Updates/Inserts
When I try to Save the Child Deletes to the database via the dataadapter i
get the following error:
InvalidOperationException:
The Collection has changed
in swedish: Mängden har ändrats. Det är inte säkert att uppräkningen kan
genomföras.
vid System.Data.RBTree`1.RBTreeEnumerator.MoveNext()
Det finns ingen rad på positionen 0.
I tried a for each datarow in datatable loop and the exception is thrown at
the next command after the first datarow is saved.
It seems that you can't move to the next row in the collection after the
deleted row is saved to the database.
Does anybody have a workaround for this problem?