473,396 Members | 1,712 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,396 software developers and data experts.

how to clear a concurrency violation error - grid editing?

Hi,

I have an app which retrieves data from a sql server table
and displays it on a datagrid. If 2 sessions of this app
are running and 2 users try to update the same record at
about the same time, one of the apps will yield a
concurrency violation error. The app with the error will
have a little red error symbol next to the record in the
datagrid, and the only way I can make the error go away
for now is to restart that session. Is there a way to
clear this error without having to restart the app?

TIA
Jerry
Nov 20 '05 #1
4 2229
There is a lot of concurrency issues in David Sceppas book.

there are numerous ways that you can deal with this, including event
handling in your data Adapters, comparing datasets, etc...

a little more info on how your updating would be appreciated.

-CJ

"Jerry" <an*******@discussions.microsoft.com> wrote in message
news:7a****************************@phx.gbl...
Hi,

I have an app which retrieves data from a sql server table
and displays it on a datagrid. If 2 sessions of this app
are running and 2 users try to update the same record at
about the same time, one of the apps will yield a
concurrency violation error. The app with the error will
have a little red error symbol next to the record in the
datagrid, and the only way I can make the error go away
for now is to restart that session. Is there a way to
clear this error without having to restart the app?

TIA
Jerry

Nov 20 '05 #2
Thanks. I did a search on google for this and found some
articles that show how to add a handler for the
dataAdapter update event. I tried that and can now sort
of trap when the concurrency violation occurs. My fix
after trapping the error is to alert the 2nd user that the
current record is already being edited and then to clear
the dataset for that user and refill it from the adapter.

I will take a look at the book you suggest. Thanks for
your reply.

Jerry.

-----Original Message-----
There is a lot of concurrency issues in David Sceppas book.
there are numerous ways that you can deal with this, including eventhandling in your data Adapters, comparing datasets, etc...

a little more info on how your updating would be appreciated.
-CJ

"Jerry" <an*******@discussions.microsoft.com> wrote in messagenews:7a****************************@phx.gbl...
Hi,

I have an app which retrieves data from a sql server table and displays it on a datagrid. If 2 sessions of this app are running and 2 users try to update the same record at
about the same time, one of the apps will yield a
concurrency violation error. The app with the error will have a little red error symbol next to the record in the
datagrid, and the only way I can make the error go away
for now is to restart that session. Is there a way to
clear this error without having to restart the app?

TIA
Jerry

.

Nov 20 '05 #3
Hi,

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q878q

Ken
---------------
"Jerry" <an*******@discussions.microsoft.com> wrote in message
news:7a****************************@phx.gbl...
Hi,

I have an app which retrieves data from a sql server table
and displays it on a datagrid. If 2 sessions of this app
are running and 2 users try to update the same record at
about the same time, one of the apps will yield a
concurrency violation error. The app with the error will
have a little red error symbol next to the record in the
datagrid, and the only way I can make the error go away
for now is to restart that session. Is there a way to
clear this error without having to restart the app?

TIA
Jerry

Nov 20 '05 #4
Thanks,
Great resource!

Jerry

-----Original Message-----
Hi,

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q878q

Ken
---------------
"Jerry" <an*******@discussions.microsoft.com> wrote in messagenews:7a****************************@phx.gbl...
Hi,

I have an app which retrieves data from a sql server table and displays it on a datagrid. If 2 sessions of this app are running and 2 users try to update the same record at
about the same time, one of the apps will yield a
concurrency violation error. The app with the error will have a little red error symbol next to the record in the
datagrid, and the only way I can make the error go away
for now is to restart that session. Is there a way to
clear this error without having to restart the app?

TIA
Jerry

.

Nov 20 '05 #5

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

Similar topics

2
by: Billy Jacobs | last post by:
I have a client who is getting a concurrency violation error whenever she tries to update a record. I can log in to the site as her simultaneously and update the record with no problem. I can...
3
by: Suzanne | last post by:
Hi All I'm having problems getting my data adapter to throw a concurrency exception with an INSERT command. I want to throw a concurrency exception if an attempt is made to enter a row into...
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...
2
by: Vladimir O¾ura | last post by:
I am building a pocket pc application that requires a datagrid. I am inserting a new row this way: private void mInsert_Click(object sender, System.EventArgs e) { try { DataRow dr =...
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...
4
by: elziko | last post by:
I have a DataTable which I did use as the source for a DataGrid, teh data table was popeulated form my database and when I made changes in the grid I used the same DataAdapter to chnage the values...
2
by: BobAchgill | last post by:
Do you know why this error might be happening? Maybe it is because I have two data adapters open on the same MDB file?? If this is the problem... how can I keep them from disturbing each other?...
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...
0
by: RKT | last post by:
I have a DataGridView bound to an MS Access table. This is a single- user application. When the User is adding or editing a row, the User may click on a Control elsewhere. That Control has context...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.