Course Content
Introduction to .NET with C#
Introduction to .NET with C#
2. Asynchronous Programming and Introduction to Web Services
3. Introduction to Databases with .NET
Stored Procedures
Important Points
- A Stored Procedure is a set of SQL commands. Each Stored Procedure has a unique name, and it acts like a function. Therefore, it can be called or executed like a function;
- Stored Procedures can be created using the
CREATE PROCEDURE
statement; - Stored Procedures can be executed using the
CALL
statement; - We can use the
ExecuteReader
orExecuteNonQuery
methods of theMySqlCommand
object for calling a Stored Procedure; - If the Stored Procedure has an OUT parameter (a parameter which has an
out
keyword before it), we need to manually specify the values for its arguments using theAddWithValue
andAdd
methods of theMySqlCommand
'sParameter
attribute; - The direction of an
out
parameter of a Stored Procedure must be set toParameterDirection.Output
before executing the Stored Procedure.
1. What is a stored procedure?
2. The following Stored Procedure retrieves the names of the top three athletes based on their scores. What is the correct method of calling this Stored Procedure?
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 1