nerdexam
Microsoft

70-516 · Question #39

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

Sign in or unlock 70-516 to reveal the answer and full explanation for question #39. 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 database table named ProductCatalog as shown in the exhibit: You add the following code segment to query the first row of the ProductCatalog table. (Line numbers are included for reference only.) 01 using(SqlConnection cnx = new SqlConnection(connString) 02 { 03 var command = cnx.CreateCommand(); 04 command.CommandType = CommandType.Text; 05 command.CommandText = "SELECT TOP 1 * FROM dbo.ProductCatalog"; 06 cnx.Open(); 07 var reader = command.ExecuteReader(); 08 if (reader.Read()) 09 { 10 var id = reader.GetInt32(0); 11 ... 12 reader.Close(); 13 } 14 } Which answer belongs in line 11?

Options

  • Avar weight = reader.GetDouble(1);
  • Bvar weight = reader.GetFloat(1);
  • Cvar weight = reader.GetDouble(1);
  • Dvar weight = reader.GetFloat(1);

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