nerdexam
Microsoft

70-516 · Question #223

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

Sign in or unlock 70-516 to reveal the answer and full explanation for question #223. 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. The application connects to a Microsoft SQL Server 2008 database. The database includes a database table named ProductCatalog as shown in the exhibit. (Click the Exhibit button.) You add the following code segment to query the first row of the ProductCatalog table. (Line numbers are included for reference only.) 01 Using cnx As var = New SqlConnection(connString) 02 Dim command As var = cnx.CreateCommand() 03 command.CommandType = CommandType.Text 04 command.CommandText = "SELECT TOP 1 * FROM dbo.ProductCatalog" 05 cnx.Open() 06 Dim reader As var = command.ExecuteReader() 07 If reader.Read() Then 08 Dim id As var = reader.GetInt32(0) 10 reader.Close() 11 End If 12 End Using You need to read the values for the Weight, Price, and Status columns. Which code segment should you insert at line 09?

Options

  • ADim weight As var = reader.GetDouble(1)
  • BDim weight As var = reader. GetDecimal (1)
  • CDim weight As var = reader.GetDouble(1)
  • DDim weight As var = 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