C # how to disable access and update statements

Source: Internet
Author: User

the parameter method is used to update the ACCESS database today. No error is returned, however, the data is not updated. Later, we found that when access is parameterized, the parameter location must be in the same order as the value assignment. Otherwise, data cannot be updated but no error is reported during the update.
For example: Update tablename set [a] = @ A1, [B] = @ A2 where [ID] = @ A3
when you add a parameter, you must add @ A, @ B, and @ ID. that is to say, you must
cmd. parameters. addwithvalue ("@ A1", a);

Cmd. Parameters. addwithvalue ("@ A2", B );

Cmd. Parameters. addwithvalue ("@ A3", ID );

If the sequence is incorrect, it cannot be updated. This is different from SQL Server. In SQL Server, you do not have to worry about the order in which parameters are added.
no bug is reported when the parameters of access are misplaced during update, but the access is not updated, therefore, you must note this when writing Programs .

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.