An unexpected error occurred while updating

This is happening in a single-user environment (on my dev machine) so I don't think it could be a race condition.

The idea behind it is that you won't end up overwriting a change that your application didn't know has happened - it's basically a little safety measure thrown in by . If it's consistent, odds are it's happening within your own logic (EG: You're actually updating the data yourself in another method in-between the select and the update), but it could be simply a race condition between two applications.

This caused the error since N - 1 rows were affected due to the trigger deleting one of the child entities itself before entity framework tried to delete it.

Just make sure table and form both have primary key and edmx updated.

Edit: Unfortunately I am no longer at liberty to reproduce the problem I was having here, because I stepped away from this project and don't remember if I eventually found a solution, if another developer fixed it, or if I worked around it. That's a side-effect of a feature called optimistic concurrency.

Not 100% sure how to turn it on/off in Entity Framework but basically what it's telling you is that between when you grabbed the data out of the database and when you saved your changes someone else has changed the data (Which meant when you went to save it 0 rows actually got updated).

Search for an unexpected error occurred while updating:

an unexpected error occurred while updating-57an unexpected error occurred while updating-12an unexpected error occurred while updating-15

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “an unexpected error occurred while updating”