All rows in the gridview are edited at one time from: [wonderful world of Meng xianhui]

Source: Internet
Author: User
Tags mdb database

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.