For web applications that only allow users to view data, or for those that include only a single user who can modify data, there's no threat of two concurrent users accidentally overwriting one another's changes.
Both click the Edit button in the Grid View around the same time.
Jisun changes the product name to "Chai Tea" and clicks the Update button. At this point in time, the database has the values "Chai Tea," the category Beverages, the supplier Exotic Liquids, and so on for this particular product.
In the first screen, we're prompted to specify the database to connect to - connect to the same Northwind database using the .
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.
Optimistic concurrency control works by ensuring that the record being updated or deleted has the same values as it did when the updating or deleting process started.
For example, when clicking the Edit button in an editable Grid View, the record's values are read from the database and displayed in Text Boxes and other Web controls. Later, after the user makes her changes and clicks the Update button, the original values plus the new values are sent to the Business Logic Layer, and then down to the Data Access Layer.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.In this tutorial we'll implement optimistic concurrency control to handle this risk.Once this groundwork has been laid, we'll be ready to create the ASP. To create a new Typed Data Set, right-click on the .As we saw in the first tutorial, doing so will add a new Table Adapter to the Typed Data Set, automatically launching the Table Adapter Configuration Wizard.In this tutorial we'll examine how to implement optimistic concurrency control.