468,761 Members | 1,751 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,761 developers. It's quick & easy.

Concurrency Violation: the Delete Command Affected 0 records

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.

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
1 4370
Bob,

I am not sure if it helps, however I think you are after the remove wich
removes a datarow, while the delete set only the rowstate to "deleted".

http://msdn.microsoft.com/library/de...emovetopic.asp

Read the explaining text on this page and than it will hopefully be clear.
Did you know that using long cost more memory (processing) than using
integer. VBnet is optimed for integer.

I hope this helps?

Cor
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Charlie Williams | last post: by
5 posts views Thread by Vayse | last post: by
11 posts views Thread by John | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.