PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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=”ProductCategory”>
<Key>
<PropertyRef Name=”ProductCategoryID” />
</Key>
<Property Name=”ProductCategoryID” Type=”int” Nullable=”false” StoreGeneraedPattern=”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?

Which code segment should you insert at line 03?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You are creating the data layer of the application. You write the following code segment. (Line numbers are included for reference only.)

01 Public Shared Function GetDataReader(sql As String) As SqlDataReader
02 Dim dr As SqlDataReader = Nothing
03
04 Return dr
05 End Function

You need to ensure that the following requirements are met: The SqlDataReader returned by the GetDataReader method can be used to retrieve rows from the database. SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed. Which code segment should you insert at line 03?

What should you do?

You are adding a process to the application. The process performs the following actions:
1. Opens a ContosoEntities context object named context1.
2. Loads a Part object into a variable named part1.
3. Calls the Dispose() method on context1.
4. Updates the data in part1.
5. Updates the database by using a new ContosoEntities context object named context2.

You need to update the database with the changed data from part1. What should you do?

Which ObjectContext method should you call?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Framework to model your entities.
You use Plain Old CLR Objects (POCO) entities along with snapshot-based change tracking. The code accesses the POCO entities directly.
You need to ensure that the state manager synchronizes when changes are made to the object graph.
Which ObjectContext method should you call?

Which code segment should you use?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code fragment.
<StackPanel TextBox.PreviewTextInput=”StackPanel_PreviewTextInput”>
<TextBox Name=”TxtBoxA”/>
<TextBox Name=”TxtBoxB”/>
<TextBox Name=”TxtBoxC”/>
</StackPanel>

You create an event handler named StackPanel_PreviewTextInput. You also have a collection of strings named Keywords. You need to ensure that TxtBoxA and TxtBoxB do not contain any of the strings in the Keywords collections. Which code segment should you use?

Which configuration should you use in web.config?

You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations.
Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site.
You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site.
Which configuration should you use in web.config?

Which code segment should you insert at line 02?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. The application uses a DataTable named OrderDetailTable that has the following columns: “ID “OrderID “ProductID “Quantity “LineTotal Some records contain a null value in the LineTotal field and 0 in the Quantity field. You write the following code segment. (Line numbers are included for reference only.)

01DataColumn column = new DataColumn(“UnitPrice”, typeof(double));
02
03OrderDetailTable.Columns.Add(column);

You need to add a calculated DataColumn named UnitPrice to the OrderDetailTable object. You also need to ensure that UnitPrice is set to 0 when it cannot be calculated. Which code segment should you insert at line 02?

Which element should you add to the system.serviceModel section in the application configuration file?

You are moving a Windows Communication Foundation (WCF) service into production. You need to be able to monitor the health of the service. You only want to enable all performance counter instances exposed by the ServiceModelService 4.0.0.0 counter group. Which element should you add to the system.serviceModel section in the application configuration file?