nerdexam
Microsoft

70-516 · Question #40

You have been assigned the task of writing code that executes an Entity SQL query that returns entity type objects that contain a property of a complex type. (Line numbers are included for reference…

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

Querying Data

Question

You have been assigned the task of writing code that executes an Entity SQL query that returns entity type objects that contain a property of a complex type. (Line numbers are included for reference only.) 01 using (EntityCommand cmd = conn.CreateCommand()) 02 { 03 cmd.CommandText = esqlQuery; 04 EntityParameter param = new EntityParameter(); 05 param.ParameterName = "id"; 06 param.Value = 3; 07 cmd.Parameters.Add(param); 08 using (EntityDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess)) 09 { 10 while (rdr.Read()) 11 { 12 ... 13 Console.WriteLine("Email and Phone Info:"); 14 for (int i = 0; i < nestedRecord.FieldCount; i++) 15 { 16 Console.WriteLine(" " + nestedRecord.GetName(i) + ": " + nestedRecord.GetValue(i)); 17 } 18 } 19 } 20 } Which code segment should you insert at line 12?

Options

  • ADbDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"]
  • BDbDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"]
  • CDataSet nestedRecord = rdr["EmailPhoneComplexProperty"]
  • DComplexDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"]

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.

Topics

#Entity SQL#EntityDataReader#complex type#DbDataRecord
Full 70-516 Practice