Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. Visual C# 2010

前端 未结 5 1822
走了就别回头了
走了就别回头了 2021-01-14 15:46

i\'m sorry. i wouldn\'t post this if i weren\'t out of ideas. i\'ve tried everything in the forums, but to no avail.

so i have 2 tables. both are empty at the beginn

5条回答
  •  青春惊慌失措
    2021-01-14 16:15

    I know this thread is old, but I'd like to share the situation in which I got this error in case anyone runs across this also from an internet search.

    I was seeing this error message in a legacy app. It turned out to be a result of a previous programmer coding up some logic that retrieved a DataTable, forcibly removed a column from it, then allowed the user to edit the DataTable in a grid. The DataTable was then passed to the adapter (an OracleDataAdapter in my case) to apply any changes.

    So...manually removing a column from a DataTable before sending it to the SqlDataAdapter can also result in this error message.

提交回复
热议问题