Rowupdating rowupdated gridview

6854933580_2c8b688306_z

Here we can update Name, Emp_Code and Emp_Age fields depending on the Id field of the "EMPLOYEE" table.Create SQL Connection We need a connection with a Microsoft SQL Server database so we can access data and perform an operation on it.

Then in the code behind I have handled the On Row Command event.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.If we look at this event we can see the Grid View nicely packages for us the new values, old values and the keys for the updating row.Unfortunately these dictionaries are only filled out if you are bound to a datasource control :(. the good old problem of getting the data from the row that is being currently edited within a Grid View. Accessing the "Controls": This method gets you access to the control in the Grid View, which might be useful based on what you are doing.

You must have an account to comment. Please register or login here!