System.Data.Linq.ChangeConflictException: Row not found or changed

后端 未结 19 2674
生来不讨喜
生来不讨喜 2020-12-07 22:21

I am trying to delete a selected gridview row using LINQ (No LINQDataSource).

When the selection is changed, the detailsview binding is changed also. I can add a new

相关标签:
19条回答
  • 2020-12-07 23:21

    As @dherrin79 indicated, this can be caused because of a precision variance between the database and the code. For me, the issue was the database column was supposed to be decimal(10,2), but it had been created as decimal(18,0). This was for a money field, so perhaps I should have used the money column type.

    So, I saved a dollar amount, like $3.14 to it, but the decimal was stripped. This resulted in the database value being changed and not matching the value in C#.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题