Prevent more user from edit in same record

Posted by Ahmedsa under ADO.NET on 2/25/2015 | Points: 10 | Views : 526 | Status : [Member] | Replies : 3
suppose i need to make update the employee as following
CREATE PROC UPDATE_EMPLOYEE
(
@EmployeeID INT,
@EmployeeName NVARCHAR(50)
)
AS
update Employee set EmployeeName=@EmployeeName where EmployeeID=@EmployeeID
Suppose I have two useres A,B
A modified or edit using stored procedure above employee no 5000 field EmployeeName
B need to modify employee no 5000 using stored procedure above field EmployeeName
i need to prevent user B To modify same record using time stamp How to do that from c# code and sql server and what modification in stored procedure to accept timestamp
EmployeeTable
EmployeeID
EmployeeName
TimeStampEmp
Meaning allow to another user after specified time




Responses

Posted by: Bandi on: 2/26/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Are you talking about concurrent/parallel users ?

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ahmedsa on: 2/26/2015 [Member] Starter | Points: 25

Up
0
Down
Yes this what i need
what i need is when allow to one users to modify record the another user cannot modify
this record

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 2/26/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
At what time interval you shouldn't allow another user to modify the record?

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response