New Year Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

GIAC GIAC Secure Software Programmer - C#.NET GSSP-NET-CSHARP Question # 43 Topic 5 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-NET-CSHARP Question # 43 Topic 5 Discussion

GSSP-NET-CSHARP Exam Topic 5 Question 43 Discussion:
Question #: 43
Topic #: 5

You work as a Windows Application Developer for ABC Inc. The company uses Visual Studio .NET as its application development platform. You create a Windows application using the .NET Framework. You create a database to maintain the record of the students. You create a table named Student. You want to retrieve names and roll number of those students whose age is less than ten years. An instance of the SqlCommand class named StudentCommand is already created. Which of the following code segments should you use to execute the query?


A.

StudentCommand.CommandType = CommandType.StoredProcedure;

StudentCommand.CommandText = "SELECT Name, Roll number FROM Student WHERE Age <

10";


B.

StudentCommand.CommandType = CommandType.StoredProcedure;

StudentCommand.CommandText = "Name and Roll number of students less than ten years";


C.

StudentCommand.CommandType = CommandType.Text;

StudentCommand.CommandText = "SELECT Name, Roll number FROM Student WHERE Age <

10";


D.

StudentCommand.CommandText = CommandText.Text;

StudentCommand.CommandType = "SELECT Name, Roll number FROM Student WHERE Age <

10";


Get Premium GSSP-NET-CSHARP Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.