What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The application uses DataContexts to query the database.
You create a function that meets the following requirements:
Updates the Customer table on the database when a customer is marked as deleted.
Updates the related entries in other tables (CustomerAddress, CustomerContacts) by marking them as deleted.
Prevents consumer code from setting the Deleted columns value directly.
You need to ensure that the function verifies that customers have no outstanding orders before they are marked as deleted. You also need to ensure that existing applications can use the updated function without requiring changes in the code.
What should you do?
Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that the application meets the following requirements:
* Displays a menu that is specific to the control selected by the user.
* Displays the menu next to the control.
Which control should you use?
Which code segment should you use in the Initialize method?
You are developing a WCF data service that will expose an existing Entity Data Model (EDM).
You have the following requirements:
* Users must be able to read all entities that are exposed in the EDM.
* Users must be able to update or replace the SalesOrderHeader entities.
* Users must be prevented from inserting or deleting the SalesOrderHeader entities
You need to ensure that the data service meets the requirements. Which code segment should you use in the Initialize method?
Which code segment should you use?
You are implementing an ASP.NET MVC 2 Web application that contains the following class.
public class DepartmentController : Controller
{
static List<Department> departments = new List<Department>();
public ActionResult Index()
{
return View(departments);
}
public ActionResult Details(int id)
{
return View(departments.Find(x => x.ID==id));
}
public ActionResult ListEmployees(Department d)
{
List<Employee> employees = GetEmployees(d);
return View(employees);
}
}
You create a strongly typed view that displays details for a Department instance.
You want the view to also include a listing of department employees.
You need to write a code segment that will call the ListEmployees action method and output the results in place.
Which code segment should you use?
What should you do?
You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master. You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.
protected void Page_Load(object sender, EventArgs e).
{ string s = Master.CityName;.
} You need to ensure that TestPage.aspx can access the CityName property. What should you do?
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use Microsoft ADO.NET Entity Data Model (EDM) to model entities. You create an entity named Person with a schema defined by the following XML fragment.
<EntityType Name=”CPerson”> <Key> <PropertyRef Name=”PersonId” /> </Key> <Property Name=”PersonId” Type=”Int32″ Nullable=”false” /> <Property Name=”CompanyName” Type=”String” /> <Property Name=”ContactName” Type=”String” /> <Property Name=”ContactTitle” Type=”String” /> <Property Name=”Address” Type=”String” /> </EntityType>
You need to ensure that entities within the application are able to add properties related to the city, region, and country of Person’s address. What should you do?
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 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?
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 approach should you recommend?
You need to design session state management for the rewritten Web application.
Which approach should you recommend?
What should you do?
You are designing an ntier Windows application by using Microsoft .NET Framework 4, Microsoft Visual Studio 2010, and Microsoft SQL Server 2008. The application will replace an existing client/server application. The existing application was created by using Microsoft Visual Basic 6.0 and consists of a series of COM components that access a SQL Server database.
You plan to move the existing COM components into a Windows Communication Foundation (WCF) tier. You need to ensure that the COM components can be replaced without impacting the existing user interface (UI) tier. You also need to ensure that the COM components can be replaced separately. What should you do?