Set select, insert, update, and delete commands for sqldatasource in ASP. net2.0

Source: Internet
Author: User

Select the products data source and check the asterisk (*) to read all database fields. However, this will only generate the SELECT command. If you still want the insert, update, and delete commands, select advanced and check the two options.

Note that only the selected table in the database can be used with the primary key. Otherwise, the advanced options are gray, if the primary key is not available, the default value of datakeynames is unknown. I used to spend a lot of time on this issue. After dragging the gridview control, I edited the update command in it. Only then did I find that datakeynames is empty and I realized this. I hope it will help you.

Related Article

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.