Information générale
Catégorie:
Code, syntaxe and commandes
Titre:
How to Lock a Sql server record
Hi.
I'm looking for an RLOCK() equivalent in C#/Sql Server
Situation is as follows:
Web Form, Lots of uers, Single Table
Any user can highlight any record and amend it.
Uses Disconnected Record, User Views, It , Possibly Amends it, and saves It
If another User has the Record, I want a visual clue on the form, and an indication that it it is read Only.
In VFP . I would do something like:
If Rlock()
messageBox('You can only View')
Endif
I realise one could use Optimistic Concncurrency, but the user will not know about this until he has spent a lot of time amneding say 20 fields, to find out (at the end ) that a different user is also amending
The user needs to know when they FIRST view the record that somebody else is using the record. Also, the user saving the record will need an Unlock facility
I presume that are ways of handling this scenario in a Disconnected fashion, in Sql Server,but I dont have any such experience of this, hence the question.
Regards,
Gerard
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement