how to clear a concurrency violation error - grid editing?

  • Thread starter Thread starter Jerry
  • Start date Start date
J

Jerry

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
 
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
 
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.
 
Back
Top