Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Lock a Sql server record
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How to Lock a Sql server record
Miscellaneous
Thread ID:
01214142
Message ID:
01214142
Views:
57
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
Map
View

Click here to load this message in the networking platform