John works as a Web Developer for ABC Inc. He develops an ASP.NET application, named MyApp1, using Visual Studio .NET. MyApp1 uses a Microsoft SQL Server 2000 database, named Database1. Database1 contains a table, named Orders, that stores the order details. In Database1, he creates a stored procedure, named Proc1, as follows:
CREATE PROCEDURE [Proc1] AS
Return (Select Count(*) from Orders)
The Proc1 stored procedure returns a count of the number of rows in the Orders table. MyApp1 includes a page, named Page1.aspx. In the Page1_Load event handler, John writes the following code to call the stored procedure:
string Str1;
SqlConnection Con;
SqlCommand Cmd1;
Str1 = "Server=TestPro1;Database=Database1;uid=sa;pwd=;";
Con = new SqlConnection(Str1);
Cmd1 = new SqlCommand("Proc1", Con);
Cmd1.CommandType = CommandType.StoredProcedure;
John wants to create an instance of the SqlParameter class that represents the return value from the Proc1 stored procedure. Which of the following code will he use to accomplish the task?
Submit