Click here to Skip to main content
15,884,388 members
Articles / Web Development / ASP.NET

ASP.NET Optimistic Concurrency Control

Rate me:
Please Sign up or sign in to vote.
4.73/5 (25 votes)
19 Aug 20039 min read 223K   2.3K   111  
How to implement the optimistic concurrency control without the DataSet
<%@ Page language="c#" Codebehind="Product.aspx.cs" AutoEventWireup="false" Inherits="Concurrency.Product" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
  <head>
    <title>Product</title>
<meta content="Microsoft Visual Studio 7.0" name=GENERATOR>
<meta content=C# name=CODE_LANGUAGE>
<meta content=JavaScript name=vs_defaultClientScript>
<meta content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema>
  </head>
<body>
<form id=Product method=post runat="server">
<table id=tblHeader cellSpacing=0 cellPadding=0 border=0>
  <tr>
    <td>
      <h1>Product Edit</h1>
      <P><asp:Label id=lblConcurrencyMsg runat="server" ForeColor="Red" Visible="False"> Another user has changed this product since you started to edit it. The changes made by the other user are shown in gray color. Please review the changes.</asp:Label></P>
     </td>
  </tr>
</table>
<table id=tblBody cellSpacing=0 cellPadding=0 border=0>
  <tr>
    <td><IMG height=0 src="Images\spacer.gif" width=140 ></td>
    <td><IMG height=0 src="Images\spacer.gif" width=200 ></td></tr>

  <tr>
    <td><asp:label id=Label1 runat="server">Product:</asp:label></td>
    <td><asp:textbox id=txtName runat="server" MaxLength="40"></asp:textbox></td></tr>
  <tr>
    <td><asp:label id=Label2 runat="server">Category:</asp:label></td>
    <td><asp:dropdownlist id=cmbCategories runat="server" width="150px"></asp:dropdownlist></td></tr>
  <tr>
    <td><asp:label id=Label3 runat="server">Supplier:</asp:label></td>
    <td><asp:dropdownlist id=cmbSuppliers runat="server" width="150px"></asp:dropdownlist></td></tr>
  <tr>
    <td><asp:label id=Label4 runat="server">Quantities per unit:</asp:label></td>
    <td><asp:textbox id=txtQtyPerUnit runat="server" MaxLength="20"></asp:textbox></td></tr>
  <tr>
    <td><asp:label id=Label5 runat="server">Unit price:</asp:label></td>
    <td><asp:textbox id=txtUnitPrice runat="server"></asp:textbox></td></tr>
  <tr>
    <td><asp:label id=Label6 runat="server">Units in stock:</asp:label></td>
    <td><asp:textbox id=txtUnitsInStock runat="server"></asp:textbox></td></tr>
  <tr>
    <td><asp:label id=Label7 runat="server">Units on order:</asp:label></td>
    <td><asp:textbox id=txtUnitsOnOrder runat="server"></asp:textbox></td></tr>
  <tr>
    <td><asp:label id=Label8 runat="server">Reorder level:</asp:label></td>
    <td><asp:textbox id=txtReorderLevel runat="server"></asp:textbox></td></tr>
  <tr>
    <td></td>
    <td><asp:checkbox id=chkDiscontinued runat="server" Text="Discontinued"></asp:checkbox></td></tr>
  <tr>
    <td></td>
    <td><asp:button id=btnAccept runat="server" Text="Acept"></asp:button><IMG src="Images\spacer.gif" width=25 > <asp:button id=btnCancel runat="server" Text="Cancel"></asp:button></td></tr></table>
<P>&nbsp;</P></form>
	
  </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Teo
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions