nerdexam
Microsoft

70-516 · Question #89

You are going to execute a Select command to SQL Server that returns several rows of customer data. You don't need a data table to hold the data because you will simply loop over the returned…

The correct answer is C. ExecuteReader. See the full explanation below for the reasoning.

Question

You are going to execute a Select command to SQL Server that returns several rows of customer data. You don't need a data table to hold the data because you will simply loop over the returned results to build a string of information that will be displayed to the user. You create and open a connection and then create the command and set its properties. Which method on the command will you execute to retrieve the results?

Options

  • AExecuteScalar
  • BClose
  • CExecuteReader
  • DExecuteNonQuery

How the community answered

(20 responses)
  • A
    15% (3)
  • B
    5% (1)
  • C
    75% (15)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice