We can achieve the same functionality using Datakeys.
This article explains how to perform insert, update and delete operations in ASP. Let us take an example to perform CRUD operations using Entity Framework Database First approach.
Suppose we’ve to work on Customer table having Category ID as foreign key.
"If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google , Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox .
The visitors to a web site can typically be divided into two groups: the users and the administrators.
If user clicks the Cancel button while Grid View is in editing mode, you need to Cancel the Editing process and also need to reset the Edit Index property to -1 in the Row Canceling Edit event of the Grid View control as shown below: The last step is to handle the Row Updating event to actually update the back end database.
To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.Last line of the following code is calling a local method for updating the database and passing all the parameters to this method.Please keep in mind that there are many different ways to update the database using the Grid View control depending on the type of data you are updating and the functionality the user need and there are many solutions to achieve the same end result.A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source. 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.