Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Concurrency Violation

Posted on 2009-05-19
1
Medium Priority
?
631 Views
Last Modified: 2013-11-08
I have a project where I am accept data to  be entered by the user in to a Datagridview.   When the user adds data and clicks save the changes are saved to the database without any issues.  The problem comes in when the user trys to add edit an existing row in the datagrid that has already been saved.  

A concurrency error is returned when trying to add or change an existing row in the datagrid after the first change has been made.   I have be reading articles all over the web about this but can't seem to find a solution.   I read somewhere  that I should not use a command builder (which I am not) and define the insert and update commands myself (which I did).   I am not sure what I need to do to resolve this my i have to find a awnser somewhere and am hoping someone can help me out.

I am using a datatable to populate the datagridview and trying to save the changes to an MSAccess database.    When trying to save the changes I am updating the dataadapter as follows:

 daItems.Update(dtItems)
0
Comment
Question by:Mike_Stevens
1 Comment
 
LVL 5

Accepted Solution

by:
AdGroot earned 2000 total points
ID: 24423808
The problem  with a concurrency error is that the update statement can't find the record he wan't  to update.

Check your where clause of the update command  if you use fields what have been changed by some other user.

In that case de update statement will not find a record and throws a exception
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question