PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you insert at line 08?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL.
The application contains the following model. You write the following code. (Line numbers are included for reference only.)

01 static void Insert()
02 {
03 NorthwindDataContext dc = new NorthwindDataContext();
04 Customer newCustomer = new Customer();
05 newCustomer.Firstname = Todd;
06 newCustomer.Lastname = Meadows;
07 newCustomer.Email = troeadows@contoso.com;
08 …..
09 dc.SubmitChanges();
10 }

A product named Bike Tire exists in the Products table. The new customer orders the Bike Tire product.
You need to ensure that the correct product is added to the order and that the order is associated with the new customer.
Which code segment should you insert at line 08?

What should you do?

You create an ASP.NET MVC 2 Web application that contains the following controller class.
public class ProductController : Controller
{
static List<Product> products = new List<Product>();
public ActionResult Index()
{
return View();
}
}
In the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive.
<%@ Page Inherits=”System.Web.Mvc.ViewPage” %>
You test the application with a browser. You receive the following error message when the Index method is invoked: “The view ‘Index’ or its master was not found.”
You need to resolve the error so that the new view is displayed when the Index method is invoked.
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>
<PostalCode>60603</PostalCode>
</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.)

Which code segment should you insert at line 04?

You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 200B database.
You populate a SqlDataAdapter by using the following code. (Line numbers are included for reference only.)

01 SqlDataAdapter dataAdapter1 = new SqlDataAdapter(“SELECT * FROM [BlogEntries] ORDER BY CreationDate, connection);
02 cmdBuilder = new SqlCommandBuilder(dataAdapter1);
03 dataAdapter1.Fill(BlogEntryDataSet, BlogEntries);
04 ….
05 connection.Close();

You need to update the blog owner for all BlogEntry records. Which code segment should you insert at line 04?

Which code segment should you use?

You are implementing a read-only page that includes the following controls.

<asp:Button ID=”btnRefresh” runat=”server” Text=”Button” />
<asp:GridView ID=”gvCustomers” runat=”server” EnableViewState=”False” OnDataBinding=”gvCustomers_DataBinding”></asp:GridView>

You disable view state to improve performance.
You need to ensure that the page is updated to display the latest data when the user clicks the refresh button.
Which code segment should you use?

Which two approaches should you recommend?

You are designing an ASP.NET Web application for online image editing. Users can upload images to the Web application and edit those images by using utilities provided by the application. Some utilities are processor intensive and should be offloaded to a Graphics Processing Unit (GPU). Other utilities require the use of proprietary algorithms that must be performed on the server.
You need to design a solution for minimizing bandwidth usage and Web server response times during image processing, while providing a responsive application.
Which two approaches should you recommend? (Each correct answer presents part of the solution. Choose two.)

What should you do?

You are creating a Windows application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. The business logic layer of the application is implemented by using Windows Communication Foundation (WCF). The application must provide maximum availability. It must be able to run in a reliable manner even when network connectivity is not available. You need to design the WCF service interaction for the business layer of the application. What should you do?