Question 126 You create an ASPNET page that display customer order information

Question 126 you create an aspnet page that display

This preview shows page 98 - 100 out of 144 pages.

Question: 126. You create an ASP.NET page that display customer order information. This information is displayed in two separate DataGrid controls on the Page. The first DataGrid control displays the current year orders, and the second DataGrid control displays all orders from previous years. The page uses both the System.Data.SqlClient namespace and the System.Data namespace. The information is stored in a Microsoft SQL Server Database. A customer’s complete order history information is obtained from the database by calling a stored procedure named GetOrders and passing the customer’s identification number as a parameter. The Page.Load event handler populates a DataView object named EXDataView with the result of calling the GetOrders stored procedure. The following code segment in the Page.Load event handler is then used to bind the two DataGrid controls to EXDataView: dataGridCurrentYear.DataSource = EXDataView EXDataView.RowFilter = “OrderDate >= #01/01/” & _ Now.Year & “#” dataGridCurrentYear.DataBind() dataGridPreviousYears.DataSource = EXDataView EXDataView.RowFilter = “OrderDate < #01/01” & _ Now.Year & “#”
Image of page 98
Exam Name: Developing and Implementing Web Applications with Microsoft Visual Basic.NET Exam Type: Microsoft Exam Code: 70-305 Total Questions: 212 Page 99 of 144 dataGridPreviousYears.DataBind(). Page.DataBind During testing, you discover that both DataGrid controls are displaying order information for the previous years only. What should you do to correct this problem? A. Remove the Page.DataBind() statement. B. Remove the dataGridPreviousYears.DataBind() statement. C. Add a Response.Flush() statement immediately before the Page.DataBind() statement. D. Add a Response.Flush() statement immediately before the dataGridPreviousYears.DataBind() statement. Answer: A Explanation: Both datagrids use the same DataView. The Page.Databind method binds a data source to the invoked server control and all its child controls. We should remove this statement. Reference: .NET Framework Class Library, Control.DataBind Method [Visual Basic] Incorrect Answers B: We must bind each data grid control to its data source C, D: The HttpResponse Flush method sends all currently buffered output to the client. It is not useful in this scenario. Question: 127. You are a Web developer for XYZ. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named XYZ01. The company purchases a factory automation software application. The application is installed on XYZ01, where it creates a second instance of SQL Server 2000 named Factory and a database named FactoryDB. You connect to FactoryDB by using Windows Integrated authentication. You want to add a page to your ASP.NET application to display inventory data from FactoryDB.
Image of page 99
Image of page 100

You've reached the end of your free preview.

Want to read all 144 pages?

  • Spring '16
  • .NET Framework, Microsoft SQL Server, Microsoft Visual Studio

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture