Datatable rowupdating in c
For a web application that allows multiple users to edit data, there is the risk that two users may be editing the same data at the same time.
Figure 3: Connect to the Same Northwind Database (Click to view full-size image) Next, we are prompted as to how to query the data: through an ad-hoc SQL statement, a new stored procedure, or an existing stored procedure.
Pessimistic concurrency is rarely used because such locks, if not properly relinquished, can prevent other users from updating data.
For example, if a user locks a record for editing and then leaves for the day before unlocking it, no other user will be able to update that record until the original user returns and completes his update.
Figure 1 graphically depicts this series of events.
Figure 1: When Two Users Simultaneously Update a Record There s Potential for One User 's Changes to Overwrite the Other 's (Click to view full-size image) Similarly, when two users are visiting a page, one user might be in the midst of updating a record when it is deleted by another user.