Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChangeConflictException in Linq to Sql

Tags:

c#

linq-to-sql

I receive "Row not found or changed exception".

System.Data.Linq.ChangeConflictException: Row not found or changed. at
System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) at
System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges()

How I to tell what column causes the exception?

Thank you.

like image 724
ITConst Avatar asked Dec 02 '25 03:12

ITConst


1 Answers

See How to: Retrieve Member Conflict Information (LINQ to SQL) if you just want code a code example.

By default in Linq2Sql, every property is included in the optimistic concurrency check. You can customize this behavior by setting the UpdateCheck property of the Column attribute in your Linq2Sql class to Always (the default), Never, or WhenChanged to only include a column in the concurrency check if its value changed. It's covered in greater detail on MSDN: Optimistic Concurrency Overview (LINQ to SQL)

like image 144
Joel C Avatar answered Dec 03 '25 18:12

Joel C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!