In actual projects, you can edit all rows of the gridview at a time to reduce the amount of data submitted back and forth, which greatly improves the user experience. The following describes how to edit all data rows in the gridview. In the following example, the database uses the aspnet20book. mdb database under site \ app_data \ in ASP. NET 2.0 application development technology. The data update method in this example uses the updatecommand attribute of the sqldatasource data source control, but this method is also applicable to stored procedures, SQL statements, and so on.
C #
Note: For SQL Server databases, the parameter name is not added @. Note: For different database types and data sources, updatecommand = "Update [Student] Set Title = @ title, Gender = @ gender, classname = @ classname where id = @ ID "Write method and sqlperformance1.updateparameters. add (new parameter ("@ title", typecode. string, (textbox) gvr. findcontrol ("txttitle ")). text); The write method will be different.