dbconcurrencyexception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I am creating a dbconcurrencyexception in my program. Update fails with 0
rows affected message. Because I changed the data in DB from SQL server
front-end after my grid fills with data. i followed the example in msdn. in
the handler, after prompting the user, i read the record from the DB and
merge it with the current dataset. And try to update db again. The result is
the same exception. Because merge does not override the original version of
the record in the grid. So what should i do to handle this exception? Shall
i refresh the data in grid depending on user's choice?

Salim
 
Hi,

The usual option is to either:
1) reload the row from the database and lose the users changes
2) overwrite the row in the database and lose the previous update - if you
do this you need to bypass your concurrency check. If you try this you need
some way to tell your update method to skip the check.
 
Back
Top