P
Pavel Gusak
I'm trying to update Access database with data from DataSet in my Web
Service.
Does not work. Generates Concurrency violation error, however, nobody works
with db at the time.
Can you help me?
The code is below.
Thanks.
protected void DataSetUpdate(DataSet ds, string tableName)
{
OleDbDataAdapter adapter;
OleDbCommandBuilder builder;
string selectCommand = "SELECT * FROM " + tableName;
adapter = new OleDbDataAdapter(selectCommand, conn);
builder = new OleDbCommandBuilder(adapter);
adapter.InsertCommand = builder.GetInsertCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
adapter.DeleteCommand = builder.GetDeleteCommand();
//adapter.ContinueUpdateOnError = true;
adapter.Update(ds, tableName);
adapter.Dispose();
}
Service.
Does not work. Generates Concurrency violation error, however, nobody works
with db at the time.
Can you help me?
The code is below.
Thanks.
protected void DataSetUpdate(DataSet ds, string tableName)
{
OleDbDataAdapter adapter;
OleDbCommandBuilder builder;
string selectCommand = "SELECT * FROM " + tableName;
adapter = new OleDbDataAdapter(selectCommand, conn);
builder = new OleDbCommandBuilder(adapter);
adapter.InsertCommand = builder.GetInsertCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
adapter.DeleteCommand = builder.GetDeleteCommand();
//adapter.ContinueUpdateOnError = true;
adapter.Update(ds, tableName);
adapter.Dispose();
}