Onrowupdating event

19-Jul-2017 21:55

So we need to create a Stored Procedure on which we pass all parameters that are updateable along with the primary key value, in other words the row data's key value that is being updated.We use the Row Updating event of Grid View to update the record in the database table.Now we define a method for opening a connection with the relation database and returns a SQL connection object depending on the connection string that is passed as a parameter of the Sql Connection class constructor.Delete a Record We can delete a record from the database table by clicking on the delete button that is in the Delete column of the Grid View.Row move in edit mode We have a Grid View with records.We can't update a record until that record doesn't exist in the input type field (Text Box).Here we can update Name, Emp_Code and Emp_Age fields depending on the Id field of the "EMPLOYEE" table.

In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field.The Edit Index property of a Grid View determines the index of a row in edit mode. Update record and get updated state of the Grid View.When a Grid View row is in edit mode then we can update the row's record in the relational database table.We define a connection in the web.config file and give a name to the connection string.Now we access this connection string on the page so we can open a connection with the relation database. The first one accesses the connection string and the other is for the SQL connection.

In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field.

The Edit Index property of a Grid View determines the index of a row in edit mode. Update record and get updated state of the Grid View.

When a Grid View row is in edit mode then we can update the row's record in the relational database table.

We define a connection in the web.config file and give a name to the connection string.

Now we access this connection string on the page so we can open a connection with the relation database. The first one accesses the connection string and the other is for the SQL connection.

In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.