H
HungTrinh
Hi All,
I use CommandBuilder to create UpdateCommand. But it raise a
"Concurrently violation" error. Could you tell us how to solve this problem.
This error rarely happen.
private static int Update(string name, DataRow row, string connection)
{
using(OleDbConnection cn = new OleDbConnection(connection))
{
cn.Open();
OleDbCommand cmd = new OleDbCommand(name, cn);
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
cmd.CommandType = CommandType.TableDirect;
OleDbCommandBuilder sqlBuilder = new
OleDbCommandBuilder(adapter);
adapter.UpdateCommand = sqlBuilder.GetUpdateCommand();
return adapter.Update(new DataRow[]{row});
}
}
Thanks,
Hung
I use CommandBuilder to create UpdateCommand. But it raise a
"Concurrently violation" error. Could you tell us how to solve this problem.
This error rarely happen.
private static int Update(string name, DataRow row, string connection)
{
using(OleDbConnection cn = new OleDbConnection(connection))
{
cn.Open();
OleDbCommand cmd = new OleDbCommand(name, cn);
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
cmd.CommandType = CommandType.TableDirect;
OleDbCommandBuilder sqlBuilder = new
OleDbCommandBuilder(adapter);
adapter.UpdateCommand = sqlBuilder.GetUpdateCommand();
return adapter.Update(new DataRow[]{row});
}
}
Thanks,
Hung