GSSP-NET · Question #353
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…
The correct answer is C. SqlParameter Parm1. See the full explanation below for the reasoning.
Question
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? GIAC GSSP-.NET Exam
Options
- ASqlParameter Parm1;
- BSqlParameter Parm1;
- CSqlParameter Parm1;
- DSqlParameter Parm1;
How the community answered
(26 responses)- A12% (3)
- B4% (1)
- C81% (21)
- D4% (1)
Community Discussion
No community discussion yet for this question.