This is really kind of a loaded question since often it may be better to use
a timestamp (rowversion column) and often you can get better performance
with stored procs, but the basic pattern would be as follows:
Create a transaction with an IsolationLevel of RepeatableRead.
Set your DataAdapter’s SelectCommand property to use the transaction.
Make the changes to your data.
Set the DataAdapter’s Insert, Update, and Delete command properties to use
the transaction.
Call the DataAdapter’s Update method.
Commit the transaction.
HTH,
Peter
--
Site:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
Short urls & more:
http://ittyurl.net
"DaveP" wrote:
How do i do Pessimistic locking in ado.net
with c#
Thanks DaveP