Updating data in gridview Clive veb cam chatroulette ukraina
This will make sure that Bind Data() method will not fire when you are going to edit, update or delete the record.
In Bind Data() method, I am getting the data from database using Sql objects and specifying the Data Source property of the Grid View to the Pages Data table of the Data Set.
I will be using Sql objects directly into methods to keep the example simple and straight forward.
When Delete link of the Grid View will be clicked, it will confirm the user whether they really want to Delete the record, if they will click OK, it will fire On Row Deleting event of the Grid View that will call Delete Record method.
To get the Primary key, I have used Data Keys property of the Grid View with the index of the row, being edited and stored into a integer variable after parsing.
Now I have declared a Grid View Row variable named row and stored the current row being edited into it.
For updating records click button “Edit” and change Text Box Data and you can select new photo of employee.
For example in place of age“28”, updated with “30” and in place of salary “50000”, updated with “55000”, then click button “Update”.