Dataadapter command attributes

Source: Internet
Author: User

Dataadapter is used to fill a dataset. To fill in a dataset, you must set the selectcommand attribute of the dataadapter object before calling the fill method of the dataadapter object. Other attributes, such as insertcommand, updatecommand, and deletecommand, must be set before the dataadapter object calls the update method. When using the update method to modify the data source, use the command attribute to modify the record. The modified information is maintained in the dataset. This information is transmitted to the parameters set and command object at one time.

The updatecommand. commandtext attribute of oledbdataadapter is used to reference an SQL statement or stored procedure for updating data in the database. This attribute is a common attribute used to obtain or set an SQL statement or stored procedure. Like the insertcommand attribute, the oledbdataadapter object uses the updatecommand attribute when calling the update () method.

Note that if you do not set the updatecommand attribute when calling the update method on a daily basis, you can use oledbcommandbuilder to automatically generate this attribute by using the change information stored in the dataset.

Therefore, you can set the updatecommand attribute or automatically generate this attribute.

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.