Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
OptimisticConcurrencyException in EntityFramework

I am using entity framework 4.3.0, while calling context.SaveChanges(), exception thrown with message...

System.Data.OptimisticConcurrencyException--> Message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

i googled for solution and i found that i have to refresh the context like,

context.Refresh(RefreshMode refreshMode, Object entity)

but, there is no any Refresh method for the context..
* EF(v4.3.0) does not include this functionality?
* so what should be another way to fix it..

thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900