Controls that support data binding expose a property named Data Source and a method called Data Bind.When the page is loaded, the Grid View is initialized to some collection of data such as Data Set and then the method Data Bind is invoked. A datakey represents the primary key field or field of a record that can uniquely identify it in a data-bound control. Row Index represents the index of the particular row.Many a times in our applications we use primary keys to get control of the particular record in the gridview.
The data access layer encapsulates the underlying SQL statements for data manipulation.Now let's configure the Optimistic Concurrency control by checking the field Modified Date to detect concurrency conflicts.Click on the Product Table Adapter and go to the Properties window (see Figure 2).needs a portal site to manage information about its products anywhere within its corporate network.We're going to use the Adventure Works database shipped with SQL Server 2005 and the table Production. The first step is two create a solution with two projects in Visual Studio 2005: a Web Site project and a Class Library project.Change the Insert, Update, Delete commands in order to support Optimistic Concurrency Control.The Insert command is shown in Listing 1, the Update command in Listing 2, and the Delete command in Listing 3.(@Name,@Product Number,@Make Flag,@Finished Goods Flag,@Color,@Safety Stock Level,@Reorder Point,@Standard Cost,@List Price,@Size,@Size Unit Measure Code,@Weight Unit Measure Code,@Weight,@Days To Manufacture,@Product Line,@Class,@Style,@Product Subcategory ID,@Product Model ID,@Sell Start Date,@Sell End Date,@Discontinued Date)Drag and drop a Grid View control onto the Data Binding Web page and configure the data binding support.You can implement the components of this layer using strongly typed Data Set.The business logic layer enables specifying business entities, business rules and workflow associated to the underlying logic of your business.For this situation, many developers use invisible columns (Hidden columns) in the gridview to identify that row. We can achieve the same functionality using Datakeys.