PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework.
The application defines the following Entity Data Model.

Within the .edmx file, the following function is defined:

<Function Name=Round ReturnType=Decimal>
<Parameter Name=val Type=Decimal />
<DefiningExpression>
CAST(val as Edm.Int32)
</DefiningExpression>
</Function>

The application includes the following LINQ query.

var query = from detail in context.SalesOrderDetails
select detail.LineTotal.Round();

You need to ensure that the Round function executes on the database server when the query is executed.
Which code segment should you use?

Which two actions should you perform?

You are implementing a new Dynamic Data Web site.
The Web site includes a Web page that has an ObjectDataSource control named ObjectDataSource1.
ObjectDataSource1 interacts with a Web service that exposes methods for listing and editing instances of a class named Product.
You add a GridView control named GridView1 to the page, and you specify that GridView1 should use ObjectDataSource1 as its data source.
You then configure GridView1 to auto-generate fields and to enable editing.
You need to add Dynamic Data behavior to GridView1.
You also must ensure that users can use GridView1 to update Product instances.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which two actions should you perform?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code segment. (Line numbers are included for reference only.) 01 Public Class Contact 02 Private _contactName As String 03 04 Public Property ContactName() As String 05 Get 06 Return _contactName 07 End Get 08 Set 09 _contactName = value 10 End Set 11 End Property 12 13 End Class You add the following code fragment within a WPF window control. <TextBox> <TextBox.Text> <Binding Path=”ContactName” UpdateSourceTrigger=”PropertyChanged”> <Binding.ValidationRules> <DataErrorValidationRule /> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox>

The TextBox control is databound to an instance of the Contact class. You need to ensure that the Contact class contains a business rule to ensure that the ContactName property is not empty or NULL. You also need to ensure that the TextBox control validates the input data. Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two).

What should you do?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the Entity Framework Designer to create the following Entity Data Model.

The application contains a class as shown in the following code segment. (Line numbers are included for reference only.)

01 public class MyBaseClass : EntityObject
02 {
03 .
04 }

You need to ensure that all generated entities inherit from MyBaseClass. What should you do?

What should you do?

You are implementing an ASP.NET Dynamic Data Web site.
The Web site includes a data context that enables automatic scaffolding for all tables in the data model.
The Global.asax.cs file contains the following code segment.

public static void RegisterRoutes(RouteCollection routes)
{
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.List,
ViewName = “ListDetails”,
Model = DefaultModel
});

routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.Details,
ViewName = “ListDetails”,
Model = DefaultModel
});
}

You need to display the items in a table named Products by using a custom layout.
What should you do?

Which two actions should you perform?

You are implementing an ASP.NET Web site.
The site contains the following class.

public class Address
{
public int AddressType;
public string Line1;
public string Line2;
public string City;
public string ZipPostalCode;
}

The Web site interacts with an external data service that requires Address instances to be given in the following XML format.

<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<ZipCode>60603</ZipCode>
</Address>

You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format requirements of the external data service.
Which two actions should you perform (Each correct answer presents part of the solution. Choose two.)

What should you do?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to several SQL Server databases. You create a function that modifies customer records that are stored in multiple databases. All updates for a given record are performed in a single transaction. You need to ensure that all transactions can be recovered. What should you do?

Which two actions should you perform?

You use Microsoft .NET Framework 4 to create a Windows Forms application. You add a new class named Customer to the application. You select the Customer class to create a new object data source. You add the following components to a Windows Form: A BindingSource component named customerBindingSource that is databound to the Customer object data source. A set of TextBox controls to display and edit the Customer object properties. Each TextBox control is databound to a property of the customerBindingSource component. A n ErrorProvider component named errorProvider that validates the input values for each TextBox control. You need to ensure that the input data for each TextBox control is automatically validated by using the ErrorProvider component.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)