A rough understanding of calling stored procedures through the select, update, delete, and insert interfaces of sqldatasource controls in. NET Framework 2.0.

Source: Internet
Author: User
Set the select, update, delete, and insert commands of sqldatasource to stored procedure, and set the output parameter in the called stored procedure. ProgramIn the corresponding selected, updated, deleted, and inserted events, use the sqldatasourcestatuseventargs e parameter in the following way:

Yourtextbox. Text = E. Command. Parameters ["@ output parameter name"]. value. tostring ();

To obtain the returned values of stored procedure from the database. Note the following points:
1. If the parameter type is set to InputOutput and output, the returned values of stored procedures can be obtained.
2. Be sure to set the parameter size. The default value of 0 will cause running errors.

In the above scenario, it seems that there is no difference in calling stored procedure in the database through select, update, delete, and insert. The four methods seem to be the same in calling the stored procedure, only serves to provide a call interface. The four names select, update, delete, and insert have no literal meaning when calling the stored procedure.

After careful attempts, the delete interface does not seem to support the above statement, but the other three can. The stored procedure I use only contains a simple SELECT command.

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.