nerdexam
Microsoft

70-516 · Question #198

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

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

Question

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following table to the database. CREATE TABLE Orders( ID numeric(18, 0) NOT NULL, OrderName varchar(50) NULL, OrderTime time(7) NULL, OrderDate date NULL) You write the following code to retrieve data from the OrderTime column. (Line numbers are included for reference only.) 01 SqlConnection conn = new SqlConnection("..."); 02 conn.Open(); 03 SqlCommand cmd = new SqlCommand("SELECT ID, OrderTime FROM Orders", conn); 04 SqlDataReader rdr = cmd.ExecuteReader(); 05 .... 06 while(rdr.Read()) 07 { 08 .... 09 } You need to retrieve the OrderTime data from the database. Which code segment should you insert at line 08?

Options

  • ATimeSpan time = (TimeSpan)rdr[1];
  • BTimer time = (Timer)rdr[1];
  • Cstring time = (string)rdr[1];
  • DDateTime time = (DateTime)rdr[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
You use Microsoft .NET Framework 4.0 to develop an application... | 70-516 Q#198 Answer | NerdExam