Web Developer Framework 4.0 Sample Questions – 34

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

  1. Override the Delete operation of the DataContext object.
  2. Override the Update operation of the DataContext object.
  3. Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the Customer and Orders tables.
  4. 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.

  1. Call the Create method of the Customer class.
  2. Call the CreateObject method of the Customer class.
  3. Override the Create method for the Customer class.
  4. 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.)

  1. Set the Debug attribute of the compilation node of the web.config file to true.
  2. Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.
  3. Select the ASP.NET debugger option in the project properties.
  4. 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

  1. Set the Value property of the EntityReference of the Order entity.
  2. Call the Add method on the EntityCollection of the Order entity.
  3. Use the AddObject method of the ObjectContext to add both Order and Customer entities.
  4. 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?

  1. Install a certificate on the Web server, and force all Web traffic to use SSL.
  2. Write an onSubmit JavaScript handler that validates all form input.
  3. Write an onSubmit JavaScript handler that URL-encodes all data that is passed to the server.
  4. 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

  1. RowDataBound
  2. RowCommand
  3. RowUpdated
  4. RowEditing

Correct Answer: 1

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.