Get datakey from gridview rowupdating

Posted by / 23-Oct-2020 16:18

Get datakey from gridview rowupdating

I know it works without the "Selecting" method but I cant recall how.

To do that we need a Row Editing event of the Grid View.

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.

The trouble is that when the call for the Select Method of the formview goes to the relevant function - "Get Customer By Cusnum" I have a null value in its parameter "cusnum".

I know that I can write a selecting event and using Command Argument, parse the value of the selected row and pass it into the Select method as a value but I dont want that solution.

get datakey from gridview rowupdating-57get datakey from gridview rowupdating-54get datakey from gridview rowupdating-53

Here we can update Name, Emp_Code and Emp_Age fields depending on the Id field of the "EMPLOYEE" table.