Hello,
When I call TableAdaptermanager.UpdateAll (in the save button event) I get a Violation of PRIMARY KEY contraint Cannot insert duplicate key in object.
This occurs if the users manipulated the primary key in a bound datagridview.
The user exchanges primary keys.
He does this:
ExampleTable
Index, Name, Enabled, Sortorder
1, Testname 1, True, 1
2, Testname 2, True, 2
3, Testname 3, True, 3
He first changes Index 2 to 4, then changed index 3 to 2 and then changes index 4 to 3 and then hit the save button.
If he presses the cancel button there should be nothing changed.
I already found a solution but can't use it. They say to remove all records and insert them again.
There are a lot of data and tables in my application that are depending on this primary key. They have cascaded update on them and should also be changed.
How to solve this issue?