nerdexam
Microsoft

70-516 · Question #118

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

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

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table named dbo.Documents that contains a column with large binary data. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.) 01 public void LoadDocuments(DbConnection cnx) 02 { 03 var cmd = cnx.CreateCommand(); 04 cmd.CommandText = "SELECT * FROM dbo.Documents"; 05 ... 06 cnx.Open(); 07 ... 08 ReadDocument(reader); 09 } You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?

Options

  • Avar reader = cmd.ExecuteReader(CommandBehavior.Default);
  • Bvar reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
  • Cvar reader = cmd.ExecuteReader(CommandBehavior.KeyInfo);
  • Dvar reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);

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