Concurrency Violation: the Delete Command Affected 0 records

  • Thread starter Bob Vlad via DotNetMonster.com
  • Start date
B

Bob Vlad via DotNetMonster.com

What I am trying to do is wipe information from a number of tables after
submission to a SQL server database. Of the 6 tables I am trying to wipe I
have had no issues with 5 of them. Multiple entries can be made and they
are then deleted. For one of the tables though, I keep getting the error
Concurrency Violation: the deleted command affected 0 records. the code is
as follows.

Dim myindex3 as Short
Dim mydefault3 as Integer
mydefault3 = 0
myindex3 = DataSet51.evidence.Rows.Count
If myindex3 <> 0 Then
Do Until mydefault3 = myindex3
Dataset51.evidence.Rows(mydefault3).Delete()
mydefault3 = mydefault3 + 1
Loop
End If
OleDbDataAdapter1.Update(Dataset51)
----this is where the error is thrown

We also checked to make sure that the fill command on page load is filling
the dataset51 correctly and that is indeed the case, since we print out the
value to the screen and can see that the count is functioning properly.
Any help on this matter would be very much appreciated.
 

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

Top