G
Guest
Hey all,
I have a dataset generated from a SQL server table using Visual Studio 2005
beta2. All of the SQL commands are auto-generated. I just dragndrop the
table over and let it do the rest.
I then created a row in the dataset and the row was successfully sent to the
sql server when I called Update(<dataset>) from the auto-generated
datasettableadapter.
I then modified the a few columns of the row and called Update(<dataset>) on
the table adapter.
I then get a concurrency violation:
'System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand
affected 0 of the expected 1 records'
I am the only one on the system so I don't see how the sql server database
is changing between the addition of the row and the update of that row.
I looked around and read two threads on this board related to the problem.
I can successfully get rid of the concurrency exception by removing the
'Optimistic Concurrency' option in the configure dataAdapter screen.
However -- I would rather have the concurrency checking on...and I'd prefer
to the use the auto-generated commands instead of manually making em (speed
isn't too big of an issue). Should it be possible, is there a bug on the
optimistic concurrency, or am I just doing something wrong?
Thanks.
I have a dataset generated from a SQL server table using Visual Studio 2005
beta2. All of the SQL commands are auto-generated. I just dragndrop the
table over and let it do the rest.
I then created a row in the dataset and the row was successfully sent to the
sql server when I called Update(<dataset>) from the auto-generated
datasettableadapter.
I then modified the a few columns of the row and called Update(<dataset>) on
the table adapter.
I then get a concurrency violation:
'System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand
affected 0 of the expected 1 records'
I am the only one on the system so I don't see how the sql server database
is changing between the addition of the row and the update of that row.
I looked around and read two threads on this board related to the problem.
I can successfully get rid of the concurrency exception by removing the
'Optimistic Concurrency' option in the configure dataAdapter screen.
However -- I would rather have the concurrency checking on...and I'd prefer
to the use the auto-generated commands instead of manually making em (speed
isn't too big of an issue). Should it be possible, is there a bug on the
optimistic concurrency, or am I just doing something wrong?
Thanks.