nerdexam
Microsoft

70-516 · Question #272

70-516 Question #272: Real Exam Question with Answer & Explanation

Sign in or unlock 70-516 to reveal the answer and full explanation for question #272. The question stem and answer options stay visible for context.

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You are creating the data layer of the application. You write the following code segment. (Line numbers are included for reference only.) 01Public Shared Function GetDataReader(sql As String) As SqlDataReader 02Dim dr As SqlDataReader = Nothing 04Return dr 05End Function You need to ensure that the following requirements are met: The SqlDataReader returned by the GetDataReader method can be used to retrieve rows from the database. SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed. Which code segment should you insert at line 03?

Options

  • AUsing cnn As New SqlConnection(strCnn)
  • BDim cnn As New SqlConnection(strCnn)
  • CDim cnn As New SqlConnection(strCnn)
  • DDim cnn As New SqlConnection(strCnn)

Unlock 70-516 to see the answer

You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-516 Practice