dbconcurrencyexception

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
 
R

Ross Donald

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top