473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Concurrency violation: the UpdateCommand affected 0 records

Hello,

I got the error "Concurrency violation: the UpdateCommand affected 0
records" while updating some records in the Windows Application. I am using
VB.net in VS 2003 and the backend is Access (2000) database.
My Code is just like as the following,

Public Function UpdateRecord (UpdatedDataSet as DataSet, myConnstr as
string, mySelectSql as string)
Dim myConn as New oleDbConnection(myConnstr)
Dim myDataAdpter as New OleDbDataAdpter
MyDataAdpter.selectCommand=New OleDbCommand(mySelectSql, myConn)
Dim updateCB as OleDbCommandBuilder =New OleDbCommandBuilde(myDataAdpter)
myConn.Open()
myDataAdpter.Update(UpdatedDataSet) ' Here is the error comes up
myConn.Close()
….
End Function

There are 80% records updated without this problem, only some of them have
this error. Please help.
Thanks in advance.

Miriam

Jul 25 '06 #1
1 1879

"Miriam" <Mi****@discussions.microsoft.comwrote in message
news:07**********************************@microsof t.com...
Hello,

I got the error "Concurrency violation: the UpdateCommand affected 0
records" while updating some records in the Windows Application. I am
using
VB.net in VS 2003 and the backend is Access (2000) database.
My Code is just like as the following,

Public Function UpdateRecord (UpdatedDataSet as DataSet, myConnstr as
string, mySelectSql as string)
Dim myConn as New oleDbConnection(myConnstr)
Dim myDataAdpter as New OleDbDataAdpter
MyDataAdpter.selectCommand=New OleDbCommand(mySelectSql, myConn)
Dim updateCB as OleDbCommandBuilder =New OleDbCommandBuilde(myDataAdpter)
myConn.Open()
myDataAdpter.Update(UpdatedDataSet) ' Here is the error comes up
myConn.Close()
..
End Function

There are 80% records updated without this problem, only some of them have
this error. Please help.
Thanks in advance.

Miriam
I've never liked CommandBuilder much. Has been known to give me unexpected
results. Could you try creating your Update command manually and seeing if
the problem goes away?

ChrisM.
Jul 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Charlie Williams | last post by:
I am having difficulty performing updates and deletions on an Access database using the Update() method of the OleDBDataAdapter. I can insert rows without a problem, but I get a concurrency...
25
by: nick | last post by:
I'm having trouble updating from a datagrid. It's says "Concurrency violation: the UpdateCommand affected 0 records", though I can't see how it's related to "concurrency". I can insert and delete...
4
by: Robert Schuldenfrei | last post by:
Dear NG, I was about to "improve" concurrency checking with a Timestamp when I discovered that my current code is not working. After about a day of beating my head against the wall, I am...
0
by: Dzemo | last post by:
i use this code to get data into dataset cmd.CommandType = CommandType.Text cmdUpdate.CommandType = CommandType.Text cmdUpdate.CommandText = "Update BigOne Set Rezultat=? where ID=?" ...
1
by: Geraldine Hobley | last post by:
Hello, I have a problem whereby I have a datagrid that is bound to a dataTable. However occassionally when I edit the datagrid I get the following message. Concurrency Violation the update...
5
by: Vayse | last post by:
In my save code, most of items save fine. But sometimes I get a concurrency violation message. "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." It happens on the...
7
by: William E Voorhees | last post by:
I'm updating an Access database in a windows multi-user environment. I'm using disconnected data I read data from an Access Data table to a data object I update the data object from a...
11
by: John | last post by:
Hi I had a working vs 2003 application with access backend. I added a couple fields in a table in access db and then to allow user to have access to these fields via app I did the following; ...
0
by: brads745678 | last post by:
Hi, I am having a problem with my VB .NET application. I am trying to do the most simplest of things, and I've even achieved this task before. All I am trying to do is update an access DB from VB...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.