B
Boris Zakharin
I have an intermittent error where I get the following exception: "Error:
Concurrency violation: the UpdateCommand affected 0 records."
Here are the steps I follow:
Create SQLConnection
Set connection string of the connection.
Open connection
Create SQL Data Adapter with the connection and a simple select statement
including an indexed column
Create SqlCommandBuilder on this adapter
Fill DataTable with the Adapter
Loop through each datarow and based on contents of a field, possibly update
another field in the same row
Call If Not tbl.GetChanges Is Nothing Then adapter.Update(tbl)
This last step is where the error occurs.
I am the only user of the system so there are no concurrency issues. When I
tried to run profiler while executing, the problem went away and I no longer
seem to be able to reproduce this problem on that machine.
Any help would be appreciated.
Thanks in advance,
Boris Zakharin
Concurrency violation: the UpdateCommand affected 0 records."
Here are the steps I follow:
Create SQLConnection
Set connection string of the connection.
Open connection
Create SQL Data Adapter with the connection and a simple select statement
including an indexed column
Create SqlCommandBuilder on this adapter
Fill DataTable with the Adapter
Loop through each datarow and based on contents of a field, possibly update
another field in the same row
Call If Not tbl.GetChanges Is Nothing Then adapter.Update(tbl)
This last step is where the error occurs.
I am the only user of the system so there are no concurrency issues. When I
tried to run profiler while executing, the problem went away and I no longer
seem to be able to reproduce this problem on that machine.
Any help would be appreciated.
Thanks in advance,
Boris Zakharin