Question: 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 column’s 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
- Override the Delete operation of the DataContext object.
- Override the Update operation of the DataContext object.
- Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the Customer and Orders tables.
- Add new entities to the DataContext object for the Customers and Orders tables.
Correct Answer: 1
Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Data Model (EDM) to define a Customer entity. You need to add a new Customer to the data store without setting all the customer’s properties. What should you do.
- Call the Create method of the Customer class.
- Call the CreateObject method of the Customer class.
- Override the Create method for the Customer class.
- Override the SaveChanges method for the Customer class.
Correct Answer: 2
Question: You are developing an ASP.NET application by using Visual Studio 2010. You need to interactively debug the entire application. Which two actions should you perform (Each correct answer presents part of the solution. Choose two.)
- Set the Debug attribute of the compilation node of the web.config file to true.
- Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.
- Select the ASP.NET debugger option in the project properties.
- Define the DEBUG constant in the project settings.
Correct Answer: 1 & 3
Question: You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the ADO.NET Entity Framework to manage customer and related order records. You add a new order for an existing customer. You need to associate the Order entity with the Customer entity. What should you do
- Set the Value property of the EntityReference of the Order entity.
- Call the Add method on the EntityCollection of the Order entity.
- Use the AddObject method of the ObjectContext to add both Order and Customer entities.
- Use the Attach method of the ObjectContext to add both Order and Customer entities.
Correct Answer: 1
Question: You are designing a user input form that is part of an ASP.NET Web Forms application. You need to ensure that users cannot attack the Web server by submitting invalid data. Which approach should you recommend?
- Install a certificate on the Web server, and force all Web traffic to use SSL.
- Write an OnClick method for the Submit button that rejects form submissions that contain invalid data.
Correct Answer: 4
Question: You are implementing an ASP.NET application. The application includes a Person class with property Age. You add a page in which you get a list of Person objects and display the objects in a GridView control. You need to add code so that the GridView row is highlighted in red if the age of the person is less than 18.Which GridView event should you handle
Correct Answer: 1