Microsoft 70-516 Exam Syllabus Topics:
| Section | Objectives |
|---|---|
| Entity Framework Data Access | - Entity data model design - CRUD operations using Entity Framework |
| Working with LINQ to SQL and LINQ to Entities | - Mapping objects to relational data - Querying data using LINQ |
| Working with ADO.NET | - Connection management and commands - Data readers and data adapters |
| Data Management and Application Integration | - Transaction management - Performance optimization and caching strategies |
| Designing Data Access Solutions | - Entity Framework vs ADO.NET considerations - Choosing appropriate data access technologies in .NET Framework 4 |
Microsoft TS: Accessing Data with Microsoft .NET Framework 4 Sample Questions:
Question #1
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the Entity Framework Designer to create an Entity Data Model (EDM).
You need to create a database creation script for the EDM. What should you do?
A. Run the Generate Database command.
B. Use a new Self-Tracking Entities template.
C. Select Run Custom Tool from the solution menu.
D. Drag entities to Server Explorer.
Question #2
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?
A. DbDataRecord nestedRecord = rdr["EmailPhoneComplexProperty"] as DbDataRecord; return nestedRecord;
B. int FldIdx = 0; EntityKey key = record.GetValue(FldIdx) as EntityKey; foreach (EntityKeyMember keyMember in key.EntityKeyValues)
{
return keyMember.Key + " : " + keyMember.Value;
}
C. int fieldCount = rdr["EmailPhone"].DataRecordInfo.FieldMetadata.Count; for (int FldIdx = 0; FldIdx < fieldCount; FldIdx++) {
rdr.GetName(FldIdx);
if (rdr.IsDBNull(FldIdx) == false)
{
return rdr["EmailPhone"].GetValue(FldIdx).ToString();
}
}
D. IExtendedDataRecord record = rdr["EmailPhone"]as IExtendedDataRecord; int FldIdx = 0; return record.GetValue(FldIdx);
Question #3
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. You retrieve an entity from an object context.
A different application updates the database. You need to update the entity instance to reflect updated
values in the database.
Which line of code should you use?
A. context.LoadProperty(entity, "Server", MergeOption.OverwriteChanges);
B. context.AcceptAllChanges();
C. context.Refresh(RefreshMode.StoreWins, entity);
D. context.LoadProperty(entity, "Client", MergeOption.OverwriteChanges);
Question #4
A performance issue exists in the application. The following code segment is causing a performance bottleneck:
var colors = context.Parts.GetColors();
You need to improve application performance by reducing the number of database calls. Which code segment should you use?
A. var colors = context.Parts.OfType<Product>().Include ("Parts.Color").GetColors();
B. var colors = context.Parts.OfType<Product>().Include("Color").GetColors();
C. var colors = context.Parts.OfType<Product>().Include ("Product.Color").GetColors();
D. var colors = context.Parts.OfType<Product>().Include("Colors").GetColors();
Question #5
You use Microsoft Visual Studio 2010 and 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 ObjectCache ( Id INT IDENTITY PRIMARY KEY, SerializedObjectData XML)
You write the following code segment to retreive records from the ObjectCache table. (Line numbers are included for reference only.)
01 string s = GetConnectionStringFromConfigFile("xmldb");
02 using (SqlConnection conn = new SqlConnection(s))
03 using (SqlCommand cmd = new SqlCommand("select * from ObjectCache",
conn))
04 {
05 conn.Open();
06 SqlDataReader rdr = cmd.ExecuteReader();
07 while(rdr.Read())
08 {
09 ...
10 DeserializeObject(obj);
11 }
12 }
You need to retreive the data from the SerializedObjectData column and pass it to a method named
DeserializeObject.
Which line of code should you insert at line 09?
A. SByte obj = (SByte)rdr[1];
B. XmlReader obj = (XmlReader)rdr[1];
C. Type obj = (Type)rdr[1];
D. String obj = (String)rdr[1];
Solutions:
| Question #1 Correct Answer: A | Question #2 Correct Answer: A | Question #3 Correct Answer: C | Question #4 Correct Answer: B | Question #5 Correct Answer: D |














868 Customer Reviews
Quality and ValueITCertKing Practice Exams are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development - no all study materials.
Tested and ApprovedWe are committed to the process of vendor and third party approvals. We believe professionals and executives alike deserve the confidence of quality coverage these authorizations provide.
Easy to PassIf you prepare for the exams using our ITCertKing testing engine, It is easy to succeed for all certifications in the first attempt. You don't have to deal with all dumps or any free torrent / rapidshare all stuff.
Try Before BuyITCertKing offers free demo of each product. You can check out the interface, question quality and usability of our practice exams before you decide to buy.
