PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

The application uses 10 themes and allows the users to select their themes for the Web page.

When a user returns to the application, the theme selected by the user is used to display pages in the application. This occurs even if the user returns to log on at a later date or from a different client computer.

The application runs on different storage types and in different environments.

You need to store the themes that are selected by the users and retrieve the required theme.

What should you do?

you add to the Web.config file?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You plan to deploy the application to a test server.You need to ensure that during
the initial request to the application, the code-behind files for theWeb pages are compiled.
You also need to optimize the performance of the application. Which code fragment should
you add to the Web.config file?

Which code segment should you insert at line 15?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You create a class that contains the following code segment. (Line numbers are included for reference only.)

01 public object GetCachedProducts(sqlConnection conn) {
02
03 if (Cache[“products”] == null) {
04 SqlCommand cmd = new SqlCommand(
05 “SELECT * FROM Products”, conn);
07 conn.Open();
08 Cache.Insert(“products”, GetData(cmd));
09 conn.Close();
10 }
11 return Cache[“products”];
12 }
13
14 public object GetData(SqlCommand prodCmd) {
15
16 }

Each time a Web form has to access a list of products, the GetCachedProducts method is called to provide this list from the Cache object.

You need to ensure that the list of products is always available in the Cache object.

Which code segment should you insert at line 15?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application consumes a Microsoft Windows Communication Foundation (WCF) service.

The WCF service exposes the following method.

[WebInvoke]
string UpdateCustomerDetails(string custID);

The application hosts the WCF service by using the following code segment.
WebServiceHost host = new WebServiceHost(typeof(CService), new Uri(“http://win/”));
ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ICService), new WebHttpBinding(), “”);

You need to invoke the UpdateCustomerDetails method.

Which code segment should you use?

What should you do?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET. The application connects to a Microsoft SQL Server 2005 database. You write
the following two DDL statements.

CREATE TABLE tblCustomers(
CustID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
CompanyName VARCHAR(50) NOT NULL,
ContactName VARCHAR(100) NOT NULL)
GO
CREATE TABLE tblCustomerOrders(
OrderID INT IDENTITY(1,1) NOT NULL,
CustID INT NOT NULL
FOREIGN KEY REFERENCES tblCustomers(CustID),
OrderDate DateTime NOT NULL)
When a user attempts to delete the data from the tblCustomers table during execution, the
application throws a SqlException exception.The application was designed without any
DataRelation objects.You need to successfully delete the data from the tblCustomers table.
What should you do?

What should you do?

You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application connects to a Microsoft SQL Server 2005 database by using LINQ to SQL. The database contains a table named MarketTransaction. The MarketTransaction records must be validated against certain business rules before they are added to or updated in the database. You need to design a validation strategy for the MarketTransaction records. You also need to ensure that the schema changes do not affect the validation code. What should you do?