Gridview rowupdating datakeynames

Point numbers 2 and 3 are performed after point 1 is performed.1.

Row move in edit mode We have a Grid View with records.

In this example, I am going to retrieve values from categories table of Northwind database. Drag a Grid View into the Web Form and assign Data Key Names property with the primary key column i.e. In the gdview_Row Editing and gdview_Row Deleting event, we have used the below code to retrieve categoryid from datakey of Grid View, int catid = int.

Re-obtaining the List of objects via the utility method along with the index obtained from the event arg parameter is not an option because the List of objects may have changed.

A Grid View Updated Event Args object is passed to the event-handling method, which enables you to determine the number of rows affected and any exceptions that might have occurred. All updated values are passed to the Stored Procedure. Now you can ask questions directly to me on my new site ASPForums. 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.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.This enables you to provide an event-handling method that performs a custom routine, such as canceling the update operation, whenever this event occurs.

185

Leave a Reply