内のデータを変更するDataGridView
と、例外が発生します。
DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
私がこれを行うとき:
// myTable is the DataSource of the datagridview.
myAdapter.Update(myTable);
VS2010 Debugger は、updateCommand
更新しようとすると次のように表示されます。
UPDATE `MySchema`.`MyDatabase`
SET `EmployeeFirstName` = @p1
WHERE ((`ID` = @p2) AND (`EmployeePhoneNumber` = @p3) AND
(`EmployeeFirstName` = @p4))
@p1 is Joe (new value changed in the datagridview)
@p4 is Sally (database value)
質問:
DBConcurrencyException
ifWHERE
句がデータベースに存在するのはなぜですか? (実際の変更はないため、同時実行違反はありません)