the UpdateCommand affected 0 of the expected 1 records请帮忙解决,谢谢
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.
数据库使用的是ACCESS,使用主键并设置自增值
使用 oleDbDataAdapter , Bindingsource ,Datagridview 绑定
网上有多种答案,但是我测试了都不行,最通常的是以下代码:
bindingSource1.EndEdit();
dataGridView1.EndEdit();
oleDbDataAdapter1.FillSchema(dataSet11, SchemaType.Mapped,"PRODUCTDATA");//new added
oleDbDataAdapter1.Update(dataSet11, "PRODUCTDATA");
上述代码测试过,是行不通的,错误仍然有.原理不用多说了,只求正确代码解决方法,请帮忙,谢谢