ChangeConflictException in Linq to Sql update

后端 未结 4 641
感动是毒
感动是毒 2020-12-14 19:57

I\'m in a world of pain with this one, and I\'d very much appreciate it if someone could help out.

I have a DataContext attached to a single test table on a database

4条回答
  •  余生分开走
    2020-12-14 20:41

    Is it possible that any of the data for the row has changed between when it was retrieved and the update was attempted? Because LINQ->SQL has automatic concurrency checking that will validate the contents of the object against the currently stored values (like you see in the generated query). If it is possible that any of the fields have changed for the row in the DB vs the object LINQ is tracking then the update will fail. If this is occurring and for good reason and you know what fields, you can update the object in the DBML designer; select the field at cause and change the "Update Check" property to "Never".

提交回复
热议问题