generally speaking,we can deal with this kind of situation in two ways:
(1)Optimistic concurrency control—With this strategy, an update to data succeeds only if no one else has changed that row after it is loaded into the DataSet object.
(2)“Last one wins” concurrency control—With this strategy, an update to data always succeeds, whether another user has edited the data or not (as long as the row still exists).
The following is one "last one wins" example:
UPDATE Customers
SET ContactName = @ContactName
WHERE CustomerID = @CustomerID
The key thing to look at here is the WHERE clause. The only column that it looks at is the CustomerID column. CustomerID is the primary key of this table, a value that should never change. As long as that one column has not been changed, the UPDATE statement succeeds,no matter what may have changed about other columns in the same table
The following is an example for the optimistic concurrency control
The difference between the two versions of the update code is the inclusion of a try-catch block to handle exceptions and the UPDATE SQL statement, which now has a different WHERE clause:
UPDATE Customers
SET ContactName = @ContactName
WHERE CustomerID = @CustomerID AND ContactName = @ContactNameOrig
The new WHERE clause finds a row to update only if both the CustomerID and ContactName fields are unchanged from what they were when the row was originally loaded.
for more information,you guys could search "Optimistic concurrency control" at google or codeproject.