OleDbAdapter.Update failure

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();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top