For Edit and Update I have added a command field which will act as the 5As discussed above I have placed 3 textboxes and a button in the Footer Row of the ASP.Net Grid View control in order to add new record to the database.aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
In addition to just displaying data, the Grid View can be used to edit and delete the displayed data as well.
The Grid View comes with a pair of complementary view controls: Details View and Form View.
By combining these controls, you can easily set up master-detail views using very little code and sometimes no code at all.
On the onclick event if the button the records are inserted into the SQL Server Database and the Grid View is updated You can view above I am simply getting the data from the textboxes in the Footer Row and then firing an update query along with the select query so that the ASP. The figure below displays the Edit and Update functionality.
The idea is to only allow a command to be performed on specific people. I'd prefer a declarative solution to a procedural one. For me converting the commandfield to a templatefield control is not an option, as the commandfield comes with built-in functionality that I would otherwise have to create myself, for example the fact that it changes to "Update Cancel" when Edit is clicked, and that when Edit is clicked, all the cells in the row which are labels become textboxes, etc.
To String() Dim stor_name As Text Box = Direct Cast(grid View.