PrepAway - Latest Free Exam Questions & Answers

Category: 70-516 (v.2)

Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4 (update October 26th, 2015)

Which code segment should you insert at line 25?

You use Microsoft Visual Studio 2010 and Microsoft NET framework 4 to create an application the
application uses the ADO NET entity framework to model entities. You define a Category class by
writing the following code segment (Line numbers are included for reference only) Public Class
Category
01 Public Class Category
02 Public Property CategorylDO As Integer
03 Get
04 End Get
05 Set
06 End Set
07 End Property
08 Public Property CategoryName() As String
09 Get
10 End Get
11 Set
12 End Set
13 End Property
14 Public Property Description() As String
15 Get
16 End Get
17 Set
18 End Set
19 End Property
20 Public Property Picture() As Byte()
21 Get
22 End Get
23 Set
24 End Set 25
26 End Property
You need to add a collection named Products to the Category class. You also need to ensure that the
collection supports deterred loading. Which code segment should you insert at line 25?

Which code would fit this business rule?

You are a tasked with performing a code review. The business rule is the following:
• If INSERTs into the first table succeed, then INSERT into the second table.
• However, if the INSERTs into the second table fail, roll back the inserts in the second table but do
not roll back the inserts in the first table.
• Although this can also be done by way of regular transactions, It needs to be performed using
• TransactionScope objects.
Which code would fit this business rule?

You need to ensure that the application meets the following requirements: Users can modify data locally and re

You use Microsoft Visual Studio 2010, Microsoft Sync Framework, and Microsoft .NET Framework 4
to create an application. You have a ServerSyncProvider connected to a Microsoft SQL Server
database. The database is hosted on a Web server. Users will use the Internet to access the
Customer database through the ServerSyncProvider. You write the following code segment. (Line
numbers are included for reference only.)
01SyncTable customerSyncTable = new SyncTable(“Customer”);
02customerSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
03
04customerSyncTable.SyncGroup = customerSyncGroup;
05this.Configuration.SyncTables.Add(customerSyncTable);
You need to ensure that the application meets the following requirements:
Users can modify data locally and receive changes from the server.
Only changed rows are transferred during synchronization.
Which code segment should you insert at line 03

Which code fragment should you add to the .edmx file?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application uses the ADO.NET Entity Framework to model entities. You create an entity as shown in
the following code fragment.
< EntityType Name=”ProductCate gory” >
< Key >
< PropertyRef Name=”ProductCategoryID” / >
< /Key >
< Property Name=”ProductCategoryID” Type=”int” Nullable=”false” StoreGenera t
edPattern=”Identity” / >
< Property Name=”ParentProductCategoryID” Type=”int” / >
< Property Name=”Name” Type=”nvarchar” Nullable=”false” MaxLength=”50″ / >

< /EntityType >
You need to provide two entity-tracking fields:
• rowguid that is automatically generated when the entity is created
• ModifiedDate that is automatically set whenever the entity is updated
Which code fragment should you add to the .edmx file

You need to ensure that the collection includes all the players from each team and every league

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The
application connects to a Microsoft SQL Server database. You create the classes shown in the
following exhibit.

You add the following code segment to the application. (Line numbers are included for reference
only.)
01public void QueryPlayers (List <League> leagues) {
02
03}
You create a LINQ query to retrieve a collection of Player objects.
You need to ensure that the collection includes all the players from each team and every league.
Which code segment should you insert at line 02


Page 15 of 31« First...10...1314151617...2030...Last »