skip to content »

Get datakeynames value rowupdating event

get datakeynames value rowupdating event-34

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.

get datakeynames value rowupdating event-57get datakeynames value rowupdating event-7

To do that we need a Row Editing event of the Grid View.You can also indicate whether the exception was handled in the event-handling method by setting the On Row Updated Row Canceling Edit On Row Canceling Edit Row Deleted On Row Deleted Row Deleting On Row Deleting Row Editing On Row Editing Row Updating On Row Updating Grid View Class System. In this article we will look at how to update or delete a record in a database table using a Grid View control.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. 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.

We get the Id value using the row index and another Text Box value is also retrieved.

All updated values are passed to the Stored Procedure.

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.

This dictionary contains all fields in the row except the key fields.