General information
Category:
Coding, syntax and commands
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only