This results in an to the corresponding Beverages category ID, and so on.
Jisun's changes to the product name have been overwritten.
Since we used ad-hoc SQL queries in our original DAL, use this option here as well.
Figure 4: Specify the Data to Retrieve Using an Ad-Hoc SQL Statement (Click to view full-size image) On the following screen, enter the SQL query to use to retrieve the product information. Discontinued = discontinued End Sub _ Public Function Update Product( By Val product Name As String, By Val supplier ID As Nullable(Of Integer), _ By Val category ID As Nullable(Of Integer), By Val quantity Per Unit As String, _ By Val unit Price As Nullable(Of Decimal), By Val units In Stock As Nullable(Of Short), _ By Val units On Order As Nullable(Of Short), By Val reorder Level As Nullable(Of Short), _ By Val discontinued As Boolean, By Val product ID As Integer, _ _ By Val original_product Name As String, _ By Val original_supplier ID As Nullable(Of Integer), _ By Val original_category ID As Nullable(Of Integer), _ By Val original_quantity Per Unit As String, _ By Val original_unit Price As Nullable(Of Decimal), _ By Val original_units In Stock As Nullable(Of Short), _ By Val original_units On Order As Nullable(Of Short), _ By Val original_reorder Level As Nullable(Of Short), _ By Val original_discontinued As Boolean, _ By Val original_product ID As Integer) _ As Boolean ' STEP 1: Read in the current database product information Dim products As _ Northwind Optimistic Concurrency.
For example, imagine that two users, Jisun and Sam, were both visiting a page in our application that allowed visitors to update and delete the products through a Grid View control.
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.
The Data Access Layer must issue a SQL statement that will only update the record if the original values that the user started editing are identical to the values still in the database. Figure 2: For the Update or Delete to Succeed, the Original Values Must Be Equal to the Current Database Values (Click to view full-size image) There are various approaches to implementing optimistic concurrency (see Peter A.
Bromberg's Optmistic Concurrency Updating Logic for a brief look at a number of options). NET Typed Data Set provides one implementation that can be configured with just the tick of a checkbox.