Rowupdating event in c
Sql Command command Type=2 records Affected=1 row=System. event is raised when a row's Update button is clicked, but before the Grid View control updates the row.This enables you to provide an event-handling method that performs a custom routine, such as canceling the update operation, whenever this event occurs.A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.
The simplest way to get the value of an IDENTITY column is to set up the identity value as an output parameter of a stored procedure and use the Sql Data Adapter to map that value back to the column in the Data Set.event returns this output: event args: (command=System. Sql Command command Type=2 status=0) The Row Updated event returns this output: event args: (command=System. Every one can use it to compare the new value with old ones.
After searching long and hard I found a great article that solved my issue.
Dim cust Adapter As Sql Data Adapter = New Sql Data Adapter( _ "SELECT Customer ID, Company Name FROM Customers", connection) ' Add handlers. Row Updating, New Sql Row Updating Event Handler( _ Address Of On Row Updating) Add Handler cust Adapter. Row Updating, _ New Sql Row Updating Event Handler(Address Of On Row Updating) Remove Handler cust Adapter.