Microsoft 70-516 Exam Overview:
| Certification Vendor: | Microsoft |
| Exam Name: | TS: Accessing Data with Microsoft .NET Framework 4 |
| Exam Number: | 70-516 |
| Available Languages: | English, French, German, Japanese, Spanish |
| Certificate Validity Period: | Retired (no longer active) |
| Exam Duration: | 90–120 |
| Real Exam Qty: | 45–55 |
| Passing Score: | 700 out of 1000 |
| Exam Price: | USD $100 |
| Related Certifications: | MCPD: Web Developer 4 MCPD: Windows Developer 4 |
| Exam Format: | Multiple Choice, Drag-and-Drop, Hot Area, Reorder, Case Studies |
| Recommended Training: | Self-Paced Training Kit (Exam 70-516) |
| Exam Registration: | Microsoft Certification Registration |
| Sample Questions: | Microsoft 70-516 Sample Questions |
| Exam Way: | Online proctored or on-site at Prometric test centers |
| Pre Condition: | No mandatory prerequisites; recommended 2–3 years experience developing data access layers with .NET Framework 4 and ADO.NET |
| Official Syllabus URL: | https://learn.microsoft.com/en-us/previous-versions//gg615038(v=msdn.10) |
Microsoft 70-516 Exam Syllabus Topics:
| Section | Weight | Objectives |
|---|---|---|
| Manipulating Data | 22% | - Synchronize data
|
| Querying Data | 22% | - Query with LINQ
|
| Developing and Deploying Reliable Applications | 18% | - Deploy and configure
|
| Modeling Data | 20% | - Define and model data structures
|
| Managing Connections and Context | 18% | - Manage concurrency
|
Microsoft TS: Accessing Data with Microsoft .NET Framework 4 Sample Questions:
1. You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. The application contains the following
code segment.
string SQL = string.Format("SELECT * FROM Customer WHERE CompanyName LIKE '%
{0}%', companyName);
var cmd = new SqlCommand(SQL, con);
You need to reduce the vulnerability to SQL injection attacks. Which code segment should you use?
A) string SQL = "SELECT" * FROM Customer @companyName; var cmd = new sqlcommand(SQL,con); cmd.Parameters.AddWithValue("companyName", string.format("where companyName LIKE '%{0}%'", companyName));
B) string SQL = string.Format("SELECT * FROM " + " Customer Where CompanyName LIKE {0}",
new SqlCommand("@companyName", string.format("%{0}%", companyName))); var cmd = new SqlCommand(SQL, con);
C) string SQL = "SELECT * FROM Customer Where " + "CompanyName LIKE @companyName"; var cmd = new SqlCommand(SQL,con); cmd.Parameters.AddWithValue("@companyName", string.Format("%{0}%", companyName));
D) string SQL = "SELECT * FROM Customer Where " + "CompanyName LIKE @companyName"; var cmd = new SqlCommand(SQL,con); var param = new SqlParameter ("@companyName", string.Format("%{0}%", companyName));
2. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that
uses the Entity Framework.
The application has an entity model that includes SalesTerritory and SalesPerson entities as shown in the
following diagram.
You need to calculate the total bonus for all sales people in each sales territory. Which code segment should you use?
A) model.SalesTerritories .GroupBy(territory => territory.SalesPersons) .SelectMany(group => group.Key) .Sum(person => person.Bonus);
B) model.SalesPersons .GroupBy(person => person.SalesTerritory) .SelectMany(group => group.Key.SalesPersons) .Sum(person => person.Bonus);
C) from person in model.SalesPersons group person by person.SalesTerritory into territoryByPerson select new {
SalesTerritory = territoryByPerson.Key,
TotalBonus = territoryByPerson.Sum(person => person.Bonus)
};
D) from territory in model.SalesTerritories group territory by territory.SalesPerson into personByTerritories select new {
SalesTerritory = personByTerritories.Key,
TotalBonus = personByTerritories.Key.Sum(person => person.Bonus)
};
3. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database.
You use the ADO.NET Entity Framework to manage persistence-ignorant entities. You create an
ObjectContext instance named context.
Then, you directly modify properties on several entities. You need to save the modified entity values to the
database.
Which code segment should you use?
A) context.SaveChanges();
B) context.SaveChanges(SaveOptions.DetectChangesBeforeSave);
C) context.SaveChanges(SaveOptions.None);
D) context.SaveChanges(SaveOptions.AcceptAllChangesAfterSave);
4. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. The database includes a table that
contains information about all the employees.
The database table has a field named EmployeeType that identifies whether an employee is a Contractor or
a Permanent employee.
You declare the Employee entity base type. You create a new Association entity named Contractor that
inherits the Employee base type.
You need to ensure that all Contractors are bound to the Contractor class. What should you do?
A) Use the Entity Data Model Designer to set up a referential constraint between the primary key of the Contractor class and EmployeeType.
B) Modify the .edmx file to include the following line of code: <NavigationProperty Name="Type" FromRole="EmployeeType" ToRole="Contractor" />
C) Use the Entity Data Model Designer to set up an association between the Contractor class and EmployeeType.
D) Modify the .edmx file to include the following line of code: <Condition ColumnName="EmployeeType" Value="Contractor" />
5. You use Microsoft .NET Framework 4.0 and the Entity Framework to develop an application.
You create an Entity Data Model that has an entity named Customer. You set the optimistic concurrency
option for Customer.
You load and modify an instance of Customer named loadedCustomer, which is attached to an
ObjectContext named context.
You need to ensure that if a concurrency conflict occurs during a save, the application will load up-to-date
values from
the database while preserving local changes. Which code segment should you use?
A) try {
context.SaveChanges();
}
catch(EntitySqlException ex)
{
context.Refresh(RefreshMode.ClientWins, loadedCustomer);
}
B) try {
context.SaveChanges();
}
catch(OptimisticConcurrencyException ex)
{
context.Refresh(RefreshMode.StoreWins, loadedCustomer);
}
C) try {
context.SaveChanges();
}
catch(EntitySqlException ex)
{
context.Refresh(RefreshMode.StoreWins, loadedCustomer);
}
D) try {
context.SaveChanges();
}
catch(OptimisticConcurrencyException ex)
{
context.Refresh(RefreshMode.ClientWins, loadedCustomer);
}
Solutions:
| Question # 1 Answer: C | Question # 2 Answer: C | Question # 3 Answer: B | Question # 4 Answer: D | Question # 5 Answer: D |

We're so confident of our products that we provide no hassle product exchange.


By Lucy


