Halloween Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

John works as a Web Developer for ABC Inc.

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?

A.

SqlParameter Parm1;

Parm1 = Cmd1.Parameters.Add("@NoOfOrders", SqlDbType.Int);

Parm1.Direction = ParameterDirection.InputOutput;

B.

SqlParameter Parm1;

Parm1 = Cmd1.Parameters.Add("@NoOfOrders", SqlDbType.Int);

Parm1.Direction = ParameterDirection.Output;

C.

SqlParameter Parm1;

Parm1 = Cmd1.Parameters.Add("@NoOfOrders", SqlDbType.Int);

Parm1.Direction = ParameterDirection.ReturnValue;

D.

SqlParameter Parm1;

Parm1 = Cmd1.Parameters.Add("@NoOfOrders", SqlDbType.Int);

GSSP-NET-CSHARP PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now GSSP-NET-CSHARP pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"