违反并发性: UpdateCommand 影响了预期 1 条记录中的 0 条。
神经了啊!整了一天了还是没有解决
我是将dataset直接插入orcal数据库的时候遇到的问题
System.Data.OracleClient.OracleDataAdapter da = new System.Data.OracleClient.OracleDataAdapter();
strSql = "select * from " + strTableName;
System.Data.OracleClient.OracleCommand cm = new System.Data.OracleClient.OracleCommand(strSql, connection);
da.SelectCommand = cm;
System.Data.OracleClient.OracleCommandBuilder cb = new System.Data.OracleClient.OracleCommandBuilder(da cb.ConflictOption = System.Data.ConflictOption.OverwriteChanges;
DataSet ds = new DataSet();
ds.Tables.Add(dt);
ds.Tables[0].TableName = strTableName;
ds.Tables[0].PrimaryKey = new DataColumn[] { ds.Tables[0].Columns["F_ID"] };
da.InsertCommand = cb.GetInsertCommand();
da.UpdateCommand = cb.GetUpdateCommand();
da.DeleteCommand = cb.GetDeleteCommand();
lock (this)
{
connection.Open();