Meanings and benefits of ASP. NET stored procedure calls

Source: Internet
Author: User

ASP. NET call Stored Procedure preface, in use. in the process of NET, database access is a very important part, especially during the construction of the B/S system, database operations have almost become an essential operation. Calling stored procedures to implement database operations enables many programmers to use the methods. Most programmers use stored procedures when they can use stored procedures, and seldom directly use SQL statements, therefore, stored procedures are very useful and important.

Introduction to ASP. NET calling Stored Procedure

Simply put, stored procedures are encapsulated by SQL statements and control statements. They reside in databases and can be called by customer applications, it can also be called from another process or trigger. Its parameters can be passed and returned. Similar to function procedures in applications, stored procedures can be called by name, and they also have input and output parameters.

Depending on the type of returned values, we can divide stored procedures into three types: stored procedures that return record sets, stored procedures that return values, also known as scalar stored procedures), and behavior stored procedures. As the name suggests, the execution result of the stored procedure that returns the record set is a record set. A typical example is to retrieve records that meet one or more conditions from the database; after the stored procedure of the returned value is executed, a value is returned. For example, a function or command with a returned value is executed in the database. Finally, the stored procedure is only used to implement a function of the database, there is no return value, for example, update or delete operations in the database.

Advantages of ASP. NET in calling stored procedures

Compared with using SQL statements directly, calling stored procedures in applications has the following benefits:

(1) reduce network traffic. The network traffic for calling a stored procedure with few rows of data may not be significantly different from that for directly calling SQL statements. However, if the Stored Procedure contains hundreds of rows of SQL statements, therefore, its performance is definitely much higher than that of a single SQL statement.

(2) Faster execution. There are two reasons: first, the database has been parsed and optimized when the stored procedure was created. Second, once the stored procedure is executed, a stored procedure will be retained in the memory, so that the next time you execute the same stored procedure, you can directly call it from the memory.

(3) better adaptability: Because stored procedures access databases through stored procedures, therefore, database developers can make any changes to the database without modifying the stored procedure interface, without affecting the application.

(4) protocol work: the coding work of applications and databases can be performed independently without mutual suppression.

From the analysis above, we can see that it is necessary to use stored procedures in applications.

This section describes the basic information about ASP. NET stored procedure calling. Does it help you understand ASP. NET stored procedure calling?

  1. Analysis of ASP. NET JavaScript and ole db Design network diary
  2. Code Analysis of Cookie deletion in ASP. NET
  3. Syntax analysis of nested If statements in ASP. NET Programming
  4. Analysis of Date and Time Processing in ASP. NET Programming
  5. Analysis of the pop-up window alarm prompt for ASP. NET Programming

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.