Microsoft
70-516 · Question #188
70-516 Question #188: Real Exam Question with Answer & Explanation
Sign in or unlock 70-516 to reveal the answer and full explanation for question #188. 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 uses the ADO.NET Entity Framework to model entities. The conceptual schema definition language (CSDL) file contains the following XML fragment. <EntityType Name="Contact"> ... <Property Name="EmailPhoneComplexProperty" Type="AdventureWorksModel.EmailPhone" Nullable="false" /> </EntityType> ... <ComplexType Name="EmailPhone"> <Property Type="String" Name="EmailAddress" MaxLength="50" FixedLength="false" Unicode="true" /> <Property Type="String" Name="Phone" MaxLength="25" FixedLength="false" Unicode="true" /> </ComplexType> You write the following code segment. (Line numbers are included for reference only.) 01 using (EntityConnection conn = new EntityConnection("name=AdvWksEntities")) 02 { 03 conn.Open(); 04 string esqlQuery = @"SELECT VALUE contacts FROM 05 AdvWksEntities.Contacts AS contacts 06 WHERE contacts.ContactID == 3"; 07 using (EntityCommand cmd = conn.CreateCommand()) 08 { 09 cmd.CommandText = esqlQuery; 10 using (EntityDataReader rdr = cmd.ExecuteReader()) 11 { 12 while (rdr.Read()) 13 { 14 ... 15 } 16 } 17 } 18 conn.Close(); 19 } You need to ensure that the code returns a reference to a ComplexType entity in the model named EmailPhone. Which code segment should you insert at line 14?
Options
- Aint FldIdx = 0;
- BIExtendedDataRecord record = rdr["EmailPhone"]as
- CDbDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"]
- Dint fieldCount =
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.