Monday, February 28, 2011

MCQ: ASP.Net More

You create a user control named Address that is defined in a file named Address.ascx. Address displays address fields in an HTML table.Some container pages might contain more than one instance of the Address user control. For example, a page might contain a shipping address and a billing address. You add a public property named TKCaption to the Address user control. The caption property will be used to distinguish the different instances.You want the caption to be displayed in the first <td> element of the table of address fields.You need to add code to the <td> element of the table to display the caption.Which code should you use?
A. <td><%=TKCaption%></td>
B. <td><script runat=”server”>TKCaption</script></td>
C. <td><script>document.write(“TKCaption”);</scripts></td>
D. <td>=TKCaption</td>
Answer: A

You are creating an ASP.NET application called TestKApp that will be used by companies to quickly create information portals customized to their business. TestKApp stored commonly used text strings in application variables for use by the page in your application. You need your application to initialize these text strings only when the first user accesses the application. What should you do?
A. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
B. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.
C. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
D. Include code in the Page.Load event handler for the default application page that sets the values if the text strings when the IsPostback property of the Page object is False.
E. Include code in the Page.Load event handler for the default application page that sets the values of the text strings when the IsNewSession property of the Session object is set to True.
Answer: A

You are creating an ASP.NET application for BMW’s human resources (HR) department.Users in the HR department will use the application to process new employees. The application automates several activities that include creating a network login account, creating an e-mail account, registering for insurance benefits, and other activities.During integration testing of your application, you need to verify that the individual activities run successfully and in the proper order.Each page in your application includes the following elements in the Page directive:Debug=”True” Trace=”True” You want each page to provide execution information in the Web browser immediately after the page’s normal display output. You need to add instrumentation to the code in your pages to
accomplish this goal.Which statement should you use?
A. Trace.Write();
B. Debug.Print();
C. System.Diagnostics.Trace.Write();
D. System.Diagnostics.Debug.Write();
E. System.Diagnostics.Debugger.Log();
Answer: A

You create an ASP.NET application for BMW. The company uses Microsoft Windows authentication. All users are in the BMW domain.You want to configure the application to use the following authorization rules: • Anonymous users must not be allowed to access the application.  • All employees except Tess and King must be allowed to access the application.Which code segment should you use to configure the application?
A. <authorization><deny users=”BMW\tess, BMW\king”><allow users=”*”><deny users=”?”></authorization>
B. <authorization><allow users=”*”><deny users=”BMW\tess, BMW\king”><deny users=”?”></authorization>
C. <authorization><deny users=”BMW\tess, BMW\king”><deny users=”?”><allow users=”*”></authorization>
D. <authorization><allow users=”BMW\tess, BMW\king”><allow users=”*”></authorization>
E. <authorization><allow users=”*”><deny users=”BMW\tess, BMW\king”></authorization>
Answer: C

You create an ASP.NET application named TKProject. You write code to specify the namespace structure of TKProject by including all class declarations within a namespace named TKNamespace. You want to compile TKProject so that the fully qualifies namespace of each class is TKNamespace. You want to prevent the fully qualifies namespace of each class from being TKProject.TKNamespace.You need to make changes in the Common Properties folder of the Property Pages dialog box for TKProject.What should you do?
A. Change the value of the AssemblyName property to TKNamespace.
B. Clear the value of the AssemblyName property and leave it blank.
C. Change the value of the RootNamespace property to TKNamespace.
D. Clear the value of the RootNamespace property and leave it blank.
Answer: D

You are creating an ASP.NET accounting application that stores and manipulates data in a Microsoft SQL Server database named BMWSrv. One of the pages in the application will be used for performing month-end operations to calculate the balance of all accounts.When a user clicks a button on the page, you want your code to run several stored procedures to calculate the month-end balances. These procedures must all succeed before the calculated balances can be stored in the database. If any of the procedures fail, then you do not want to store any of the month-end calculated balances. While the procedures are running, you do not want any users to be able to edit, add, or delete data in the tables affected by the procedures.What should you do?
A. Create a class derived from System.EnterpriseServices.ServicesComponent to run the stored procedures.Annotate the class by using a TransactionAttribute type of attribute.Set the Value property of the attribute to TransactionOption.RequiresNew.
B. Create a master stored procedure.Use this master stored procedure to call the other stored procedures that perform the monthend operations.Add WITH REPEATABLEREAD to the master stored procedure.
C. Use structured exception handling to catch a SqlException if one of the stored procedures fails.Use the Procedure property of the SqlException to identify which stored procedure generated the exception, and call a stored procedure to reserve the previous calculations.
D. Set the IsolationLevel property of a SqlTransaction object to IsolationLevel.Serializable.Assign the SqlTransaction object to the Transaction property of the SqlCommand object.Use a SqlCommand object to run the stored procedures.
Answer: D

You are a Web developer for an online research service BMW Research Inc. You are creating an ASP.NET application that will display research results to users of the BMW Web site.You use a DataGrid control to display a list of research questions and the number of responses received for each question. You want to modify the control so that the total number of responses received is displayed in the footer of the grid. You want to perform this task with the minimum amount of development effort.What should you do?
A. Override the OnPreRender event and display the total when the footer row is created.
B. Override the OnItemCreated event and display the total when the footer row is created,
C. Override the OnItemDataBound event and display the total when the footer row is bound.
D. Override the OnLayout event and display the total in the footer row.
Answer: C

You create an ASP.NET application that will run on BMW’s Internet Web site. Your application contains 100 Web pages. You want to configure your application so that it will display customized error messages to users when an HTTP code error occurs.You want to log the error when an ASP.NET exception occurs. You want to accomplish these goals with the minimum amount of development effort.Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Create an Application_Error procedure in the Global.asax file for your application to handle ASP.NET code errors.
B. Create an applicationError section in the Web.config file for your application to handle ASP.NET code errors.
C. Create a CustomErrors event in the Global.asax file for your application to handle HTTP errors.
D. Create a CustomErrors section in the Web.config file for your application to handle HTTP errors.
E. Add the Page directive to each page in the application to handle ASP.NET code errors.
F. Add the Page directive to each page in the application to handle HTTP errors.
Answer: A, D

BMW is developing an ASP.NET application for producing comparative insurance quotes from multiple insurance carries. BMW wants the application to provide quotes to a user after the user answers questions about individual insurance needs. You deploy a copy of the application to BMW’s testing environment so that you can perform unit testing.The Machine.config file on the testing server contains the following element:<trace enabled=”false” pageOutput=”false”/>
The Web.config file for your application contains the following element:<trace enabled=”false” pageOutput=”false”/>When you run the application, you find that not all insurance carries are being displayed on the quote result page. You attempt to view the trace output information for the quote results page by browsing to the trace.axd URL for your application. No trace information is shown.You want to be able to examine trace output information by using trace.axd. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Modify the element in the Machine.config file as follows:<trace enabled=”true” pageOutput=”false”/>
B. Modify the element in the Machine.config file as follows:<trace enabled=”true” pageOutput=”true”/>
C. Modify the element in the Web.config file as follows:<trace enabled=”true” pageOutput=”false”/>
D. Modify the element in the Web.config file as follows:<trace enabled=”true” pageOutput=”true”/>
E. Modify the Page directive for the quote results page so that it contains the following entry:Trace=”true”
Answer: C, D

You create an ASP.NET application and deploy it on a test server named BMWSrv. The application consists of a main page that links to 30 other pages containing ASP.NET code.You want to accomplish the following goals: • Enable tracing on all the pages in the application except the main page. • Display trace output for up to 40 requests. • Ensure that trace output is appended to the bottom of each of the pages that will
contain trace output. • Ensure that any configuration changes affect only this application.You need to accomplish these goals with the minimum amount of development effort.Which three actions should you take? (Each correct answer presents part of the solution.Choose three)
A. Add the following element to the Web.config file:<trace enabled=”true” pageOutput=”true”/>
B. Add the following attribute to the Trace element of the application’s Web.config file:requestLimit=40
C. Add the following attribute to the Trace element of the application’s Machine.config file:requestLimit=40
D. Set the Trace attribute of the Page directive to true for each page except the main page.
E. Set the Trace attribute of the Page directive to false for the main page.
F. Set the TraceMode attribute of the Page directive to SortByTime for the main page.
Answer: A, B, E

You are a Web developer for BMW. 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 TestK01.The company purchases a factory automation software application. The application is installed on TestK01, 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. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on TestK01.Which string should you use?
A. “Server=TestK01;Data Source=Factory;Initial Catalog=FactoryDB;Integrated Security=SSPI”
B. “Server=TestK01;Data Source=Factory;Database=FactoryDB;Integrated Security=SSP1”
C. “Data Source=TestK01\Factory;Initial Category=Factory;Integrated Security=SSP1”
D. “Data Source=TestK01\Factory;Database=FactoryDB;Integrated Security=SSP1”
Answer: D

You create an ASP.NET application to provide online order processing to BMW customers.A page named ShippingInformation.aspx contains a Web Form with controls for collecting shipping location information. The Web Form contains the following elements:• Four TextBox controls for entry of name, street address, city, and postal code.• A DropDownList control that consists of the full names of 150 countries.• A Button control named shipItButton.
The Click event handler for shipItButton is located in the code-behind file for ShippingInformation.aspx. None of the other controls on the Web Form define server-side event handlers.The Click event handler for ShipItButton redirects the user to a page named ShippingConfirmation.aspx. The ShippingConfirmation.aspx page provides the confirmation status of the shipping request submission to the user.Users who access the application by using dial-up connections report that ShippingInformation.aspx processes very slow after the user clicks the shipItButton. Users on high-bandwidth network connections do not report the same issue.You need to decrease the delay experienced by the dial-up users. What should you do?
A. Add the following attribute to the Page directive for ShippingInformation.aspx:EnableViewState=”False”
B. Add the following attribute to the Page directive for ShippingInformation.aspx:SmartNavigation=”True”
C. Add the following attribute to the OutputCache directive for ShippingInformation.aspx:Location=”server”
D. Add the following attribute to the OutputCache directive for ShippingInformation.aspx.Location=”client”
Answer: A

You are creating an ASP.NET application to track BMW sales orders. The application uses an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders,and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order.What should you do?
A. Add a DataRelation object to the Relations collection of the DataSet object.
B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other.
C. Add a ForeignKeyConstraint to the OrderDetails table.
D. Add a keyref constraint to the DataSet schema.
Answer: A

You ASP.NET application manages order entry data by using a DataSet object named TKorderEntry. The TKorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?
A. The current value of OrderDetails.KeyDeleteRule is Rule.Cascade.
B. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
C. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault.
D. The current value of OrderDetails.KeyDeleteRule is Rule.None.
Answer: D

You are creating an ASP.NET application for BMW. Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine.You need to make the XML Web service available to your application.What should you do?
A. On the .NET tab of the Reference dialog box, select System.Web.Services.dll.
B. In the Web References dialog box, type the address of the XML Web service.
C. Add a using statement to your Global.asax.cs file, and specify the address of the XML Web service.
D. Write an event handler in the Global.asax.cs file to import the .wsdl and .disco files associated with the XML Web service.
Answer: B

You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named requestTKDate. The date must be no earlier than two business days after the order date, and no later that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window, you set the ControlToValidate property to requestTKDate.You need to ensure that the date entered in the requestDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server.What should you do?
A. Set the AutoPostBack property of requestDate to False.Write code in the ServerValidate event handler to validate the date.
B. Set the AutoPostBack property of requestDate to True.Write code in the ServerValidate event handler to validate the date.
C. Set the AutoPostBack property of requestDate to False.Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
D. Set the AutoPostBack property of requestDate to True.Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
Answer: C

You create an ASP.NET application to provide corporate news and information to BMW’s employees. The application is used by employees in New Zealand. Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code: currentDateLabel.Text = DateTime.Now.ToString(“D”) You need to ensure that the data is displayed correctly for employees in New Zealand. What should you do?
A. In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ.
B. In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ.
C. In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8.
D. In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.
Answer: A

You are a member of a team of developers creating several ASP.NET applications for BMW. You want to create a reusable toolbar that will be used in each of the applications.The toolbar will be displayed at the top of each page viewed by the user.The contents of the toolbar will vary depending on options each user selects when creating a profile.You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team.What should you do?
A. Create a new Web Control Library project.Create the toolbar within a Web custom control.
B. Add a new Web user control to your ASP.NET project.Create the toolbar within the Web user control.
C. Add a new Web Form to your ASP.NET project.Design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D. Add a new component class to your ASP.NET project.Design the toolbar within the designer of the component class.
Answer: A

You are creating an ASP.NET application for BMW. The application will be used to identify potential customers.Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine. You want to merge this DataSet object into a DataSet object containing a list of companies that are potential customers.You specify wideWorld as the name of the DataSet object form Wide World Importers, and you specify customerProspects as the name of the DataSet object containing potential customers. After the merge, customerProspects will include the company names in wideWorld.The two DataSet objects contain tables that have the same names and primary keys. The tables in the two DataSet objects contain columns that have the same names and data types. A table in wideWorld also contains additional columns that you do not want to add to customerProspects. If customerProspects included any tables containing rows with pending changes, you want to preserve the current values in those rows when the merge occurs.Which lime of code should you use to merge the wideWorld DataSet object into customerProspects DataSet object?
A. customerProspects.Merge (wideWorld, true,MissingSchemaAction.Ignore);
B. customerProspects.Merge (wideWorld, true,MissingSchemaAction.AddWithKey);
C. wideWorld.Merge (customerProspects, true,MissingSchemaAction.Ignore);
D. wideWorld.Merge (customerProspects, true,MissingSchemaAction.Add);
Answer: A

You are creating an ASP.NET page for selling movie tickets. Users select a region, and then they select from a list of cities in that region. The site displays the names and locations of movie theaters in the city selected by the user.Your company, BMW Brothers, maintains a list of theaters in a database table that includes the city, name, and street address of each theater. You want to minimize the time required to retrieve and display the list of theater names after a user selects the region and city.What should you do?
A. Modify the connection string to add the packet size property and set its values to 8192.
B. Add the following directive to the page:OutputCache VaryByParam=”city”
C. Add the following directive to the page:OutputCache VaryByControl=”region;city”
D. Modify the connection string to keep your database’s connection pool as small as possible.
Answer: B

You are creating an ASP.NET page for BMW. The page uses string concatenation to gather data from multiple e-mail messages and format the data for display on the page.You want to ensure that the page displays as quickly as possible.What should you do?
A. Write code that uses the Append method of the StringBuilder object.
B. Write code that uses the Substring method of the String object.
C. Write code that uses the Concat method of the String object.
D. Write code that uses the plus-sign (+) operator to concatenate the strings.
Answer: A

You create an ASP.NET application that produces sales reports for the BMW corporation.The sales data is stored in a Microsoft SQL Server database that is used for transaction processing. The application consists of complex Transact-SQL statements.Many users report that the report generation is taking longer to run each day. You need to improve response times.What are two possible ways to achieve this goal? (Each correct answer presents a complete
solution. Choose two)
A. Use an OleDbDataAdapter indexes exist on the SQL Server tables.
B. Ensure that appropriate indexes exist in the SQL Server tables.
C. Rewrite your SQL statements to use aliases for all table names.
D. Rewrite your direct SQL statements as stored procedures and call the stored procedures from
your application.
E. Configure queries to run in the security context of the user who is running the query.
Answer: B, D

You create an ASP.NET page that uses images to identify areas where a user can click to initiate actions. The users of the application use Internet Explorer.
You want to provide a pop-up window when the user moves the mouse pointer over an image.You want the pop-up window to display text that identifies the action that will be taken if the user clicks the image.What should you do?
A. For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.
B. For each image, set the ToolTip property to specify the text you want to display.
C. In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.
D. In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.
Answer: B

You create an ASP.NET application. You implement tracing and debugging instrumentation.The application is deployed on BMW’s intranet.After working with the application for several days, users report that some pages are displaying errors that incorrectly identify valid date values as being invalid.You need to gather debugging information from the application while it is running in the production environment. You need to perform this task with the least impact on the performance of the application.What should you do?
A. Enable Debug mode in the application’s Web.config file on the production server.Use Visual Studio .NET on your client computer to select Debug Processes from the Tools menu and attach to the aspnet_wp.exe process on the production server.
B. Enable Debug mode in the application’s Web.config file on the production server.Use Visual Studio .NET on your client computer to open the application project on the production server and select Start from the Debug menu.
C. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server.View the debugging information on the trace.axd page.
D. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server.Run the DbgClr.exe and attach to the aspnet_wp.exe process on the production server.
Answer: A

You are creating an e-commerce site for BMW. Your site is distributed across multiple servers in a Web farm.Users will be able to navigate through the pages of the site and select products for purchase.You want to use a DataSet object to save their selections. Users will be able to view their selections at any time by clicking a Shopping Cart link.You want to ensure that each user’s shopping cart DataSet object is saved between requests when the user is making purchases on the site.What should you do?
A. Create a StateBag object.Use the StateBag object to store the DataSet object in the page’s ViewState property.
B. Use the HttpSessionState object returned by the Session property of the page to store the DataSet object.Use the Web.config file to configure an out-of-process session route.
C. Use the Cache object returned by the page’s Cache property to store a DataSet object for each user.Use an HttpCachePolicy object to set a timeout period for the cached data.
D. Use the Session_Start event to create an Application variable of type DataSet for each session.Store the DataSet object in the Application variable.
Answer: B

You are creating an ASP.NET page for BMW. BMW Employees will use the page to enter suggested names for new products. Each suggestion is saved in a Microsoft SQL Server database. The table in the database for suggestion includes the following three columns.Column name Content EmployeeID identification number of employee making a suggestion ProductID identification number for the product being named Suggestion suggested name for product To add a suggestion to the ASP.NET page, an employee logs on by entering the appropriate EmployeeID and password. The employee then uses a drop-down list box to select a ProductID
and uses a grid to enter suggested names for that product. The employee can enter multiple suggestions for a single products before submitting the page.
The database table has a unique index that includes the EmployeeID, ProductID, and Suggestion columns. The unique index does not allow the same suggested name to be recorded twice for the same product by the same employee.You are using a SqlDataAdapter object to insert the suggestions into the database. If one of the suggested names for a product is a duplicate, the database returns an error to your code. You do not want such errors to interrupts processing. You want your code to continue inserting any remaining suggestions entered by the employee. You also want to be able to access a list of any suggested names that were skipped due to errors.What should you do?
A. Set the SqlDataAdapter object’s ContinueUpdateOnError property to true before calling the object’s Update method.
B. Enclose your call to the SqlDataAdapter object’s Update method in a try/catch block.In the Catch code, set the object’s ContinueUpdateOnError property to true.
C. Create an event handler for the SqlDataAdapter object’s RowUpdated event.In the event handler, if the SqlRowUpdatedEventArgs object’s UpdateStatus property has a value of UpdateStatus.ErrorsOccured, then set the SqlDataAdapter object’s ContinueUpdateOnErrorProperty to true.
D. Create an event handler for the SqlDataAdapter object’s RowUpdated event.In the event handler, if the SqlRowUpdatedEventArgs object’s Errors property returns a nonnull value, then set the SqlDataAdapter object’s ContinueUpdateOnError property to true.
Answer: A

You are creating an ASP.NET application that uses the Microsoft SQL Server .NET Data Provider to connect to BMW’s database. Your database administrator reports that, due to heavy usage of the application, data requests are being blocked while users wait for new connections to be created.You want to improve throughput by setting a minimum connection pool size of 10.What should you do?
A. Add a connection element under an appSettings element in the Web.config file for your application, and specify a minimum size of 10 for the connection pool.
B. Add a connection element under an appSettings element in the Machine.config file on your Web server, and specify a minimum size of 10 for the connection pool.
C. Add a Min Pool Size property to the connection string you use when opening a connection,and specify a minimum size of 10 for the connection pool.
D. Add a Min Pool Size property to your ADO.NET connection objects, and assign a value of 10to the property.
Answer: C

You are creating an ASP.NET application for BMW. An earlier version of the application uses ActiveX components that are written in Visual Basic 6.0. The new ASP.NET application will continue to use the ActiveX components.You want the marshaling of data between your ASP.NET application and the ActiveX
components to occur as quickly as possible.Which two actions should you take? (Each correct answer presents part of the solution. Choose
two)
A. Use ODBC binding.
B. Use late binding.
C. Use early binding
D. Set the AspCompat attribute of the Page directive to true.
E. Set the AspCompat attribute of the Page directive to false.
Answer: C, D

You are creating an ASP.NET application for BMW. The company data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a way that achieves this goal.What should you do?
A. Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored procedure that returns the data.
B. Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.
C. Configure SQL Server to support HTTP access, and create an XML template to run a stored procedure that returns the data in XML format.
D. Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object to run a SQL statement that returns the data.
Answer: B

You create English, French, and German versions of a test engine ASP.NET application you are developing for BMW Inc. You have separate resource files for each language version.You need to deploy the appropriate resource file based on the language settings of the server.What should you do?
A. Create an installer and set the Installer.Context property for each version of your application.
B. Create an installer that has a launch condition to verify the locale settings.
C. Create an installer that has a custom action to install only location-specific files.
D. Create an installer that has an MsiConfigureProduct function to install the appropriate
version.
Answer: C

You are creating an ASP.NET page to retrieve sales data from a Microsoft SQL Server database. You are writing a method named GetTestKSales to run a stored procedure in the SQL Server database. The stored procedure has one input parameter that is used to specify a product. The stored procedure returns to the year-to-date sales for that products.You declare a numeric variable in the GetTestKSales method. You want to assign the return value of the stored procedure to the variable.What should you do?
A. Create a SqlDataAdapter object and call its Fill method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
B. Create a SqlDataAdapter object and call its Update method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
C. Create a SqlCommand object and call its ExecuteScalar method to run the stored procedure and assigns the year-to-date sales value to your numeric variable.
D. Create a SqlCommand object and call its ExecuteReader method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
Answer: C

You are creating an ASP.NET application for BMW. Your code uses the System.Data namespace. The marketing managers at your company use a page on your Web site to edit the prices of the company’s products. You retrieve product part numbers, named, and prices from a database. You store this information in a DataSet object named productInfo, and you display the data on the Web page.The marketing managers use your page to edit one or more prices, and you record these
change in productInfo. The marketing managers click a Save button to save their changes.You write code in the Click event handler for the Save button to save the edited prices to the database. You want to extract the edited rows in productInfo before performing the update.You create a second DataSet object named productChanges to hold only edited product data.Which line of code should you use to copy the edited rows from productInfo into
productChanges?
A. productChanges = productInfo.GetChanges(DataRowState.Detached);
B. productChanges = productInfo.GetChanges();
C. productChanges.Merge(productInfo, true);
D. productChanges.Merge(productInfo, false);
Answer: B

You are creating an ASP.NET application for an online payment service. The service allows users to pay their bills electronically by using a credit card.
The application includes a payment page named Payment.aspx. This page contains a form for entering payee, payment amount, and credit card information. When a user needs to submit a new billing address to a payee, the page form allows the user to provide the new address information.If the user indicates a change of address, the application needs to provide the information to the ProcessAddressChange.aspx page for processing as soon as the user submits the payment
page information. The ProcessAddressChange.aspx page processes the request for a change of address but does not provide any display information for the user.
When the requested processing is complete. Payment.aspx displays status results to the user.You need to add a line of code to Payment.aspx to perform the functionality in ProcessAddressChange.aspx. Which line of code should you use?
A. Response.Redirect(“ProcessAddressChange.aspx”);
B. Response.WriteFile(“ProcessAddressChange.aspx”);
C. Server.Transfer(“ProcessAddressChange.aspx”,True);
D. Server.Execute(“ProcessAddressChange.aspx”);
Answer: D

You are planning the deployment of an ASP.NET application named TestKApp. TestKApp uses a Visual Studio .NET component named DataAccess that will be shared with other applications on your Web server.You are using Visual Studio .NET to create a Windows Installer package. You need to deploy DataAccess and the ASP.NET application so that they can be uninstalled later if necessary.What should you do?
A. Create a setup project for DataAccess.Add the ASP.NET application in a custom action.
B. Create a setup project for the ASP.NET application.Create another setup project for DataAccess.
C. Create a Web setup project for the ASP.NET application.Add a project output for DataAccess.
D. Create a Web setup project for the ASP.NET application.Add a merge module for DataAccess.
Answer: D

You are creating an ASP.NET page that displays a list of products. The product information is stored in a Microsoft SQL Server database. You use SqlConnection object to connect to the database.Your SQL Server computer is named BMW1. The database that contains the product information is named SalesDB. The table that contains the product information is named Products. To connect to SalesDB, you use a SQL Server user account named WebApp that has
the password TestKi12.You need to set the ConnectionString property of the SqlConnection object.Which string should you use?
A. “Provider=SQLOLEDB.1;File Name =”Data\MyFile.udl
B. “Provider=MSDASQL;Data Source=BMW1;Initial Catalog=SalesDB;User ID=WebApp;Password=TestKi12”
C. “Data Source=BMW1;Initial Catalog=SalesDB;User ID=WebApp;Password=TestKi12”
D. “Data Source=BMW1;Database=SalesDB;Initial File Name=Products;User ID=WebApp;Pwd=TestKi12”
Answer: C

You are creating and ASP.NET application for the mortgage services department of BMW Inc. The application will be used for generating documents required during the closing process of a home purchase.BMW already has a component written in Visual C# .NET that identifies which forms are required to be printed based on a set of criteria specified by the closing agent. The name of the component namespace is BMW.Mortgage. The name of the class is Closing.You create an ASP.NET page named Purchase.aspx. You add a reference to the assembly that contains the BMW.Mortgage namespace. The code behind file for Purchase.aspx includes the following code:using BMW.Mortgage; You add a method to the code-behind file to instantiate the Closing class.Which code segment should you include in the method to instantiate the class?
A. Closing TKClosing = new Closing();
B. Closing TKClosing =Server.CreateObject(“BMW.Mortgage.Closing”);
C. object TKClosing =Server.CreateObject(“closing”);
D. Type TKType =Type.GetTypeFromProgID(“BMW.Mortgage.Closing”,“localhost”, true);
Answer: A

You are debugging an ASP.NET application that was written by other developers at BMW.The developers used Visual Studio .NET to create the application. A TextBox control on one of the .aspx pages incorrectly identifies valid data values as being invalid.You discover that the validation logic for the TextBox control is located within a method that is defined in client-side code. The client-side code is written in Visual Basic Scripting Edition.You want to verify that the validation method is receiving valid input parameters when the page is running. You need to perform this task by stepping through the client-side code as it runs.Which four courses of action should you take? (Each correct answer presents part of the solution. Choose four)
A. In Internet Explorer, clear the Disable script debugging check box in the advanced options and browse to the page that contains the client-side code.
B. In Visual Studio .NET, select Debug Processes from the Tools menu and attach to the local copy of IExplore.exe.In the Running Document window, select the .aspx page that you want to debug.
C. Create a new active solution configuration named Client and copy the settings from the Release configuration.Select the new configuration in the Configuration Manager.
D. Set the following attribute in the application’s Web.config file:debug=”true”
E. In Solution Explorer, open the source for the .aspx file that you want to debug and select Start from the Debug menu.
F. In Visual Studio .NET, set a breakpoint or add a Stop statement in the client-side code where you want to begin interactive debugging.
G. In Internet Explorer, perform the actions that cause the client-side code to run.
Answer: A, B, F, G

You are using ASP.NET and ADO.NET to create an accounting application for BMW. You are writing code to run a set of stored procedures that perform posting operations in a database at the end of each month.You use an OleDbConnection object to connect to the database. You use an OleDbCommand object to run the stored procedures.If an error occurs during execution of any of the stored procedures, you want to roll back any data changes that were posted. You want the changes to be committed only of all of the posting operations succeed.You write code to catch an OleDbException object if an error occurs during the execution of a stored procedure.What else should you do?
A. Call the BeginTransaction method of the OleDbConnection object before running the stored procedure.If an error occurs, use the OleDbConnection object to roll back the changes.
B. Call the BeginTransaction method of the OleDbConnection object before running the stored procedures.If an error occurs, use the OleDbException object to roll back the changes.
C. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Assign the OleDbTransaction object to the Transaction property of your OleDbCommand object.If an error occurs, use the OleDbTransaction object to roll back the changes.
D. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Pass a reference to the OleDbTransaction object to each stored procedure.Use error handling inside the stored procedures to roll back the changes.
Answer: C

You create a reporting application for BMW’s Travel. You create several reports, each of which resides in its own folder under the Report folder. Each subfolder has the appropriate security rights sets for Microsoft Windows users.You write a function named ListReports that generate a list of available reports. You want to configure the application and the ListReports function to find out which reports are available to the current user.If a user is logged in by using Windows authentication, you want ListReports to apply that user’s rights. If the user is not logged in by using Windows authentication, you want
ListReports to use the rights granted to the BMWtravel\ReportingAccount user account. The password for this user accounts is “p1testki32” Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Add the following element to the Web.config file:<identity impersonate=”false”>
B. Add the following element to the Web.config file.<identify impersonate=”true”>
C. Add the following element to the Web.config file:<identity impersonate=”true” userName=”margiestravel\ReportingAccount” password=” p1testki32”>
D. Add the following element to the Web.config file:<authorization><allow user=”BMWtravel\ReportingAccount”></authorization>
E. Add code to the ListReports function to create and use a WindowsPrincipal object based on the BMWtravel\ReportingAccount user account only if no user is authenticated.
F. Add code to the ListReports function to always create and use a WindowsPrincipal object based on the BMWstravel\ReportingAccount user account.
Answer: B, E

You plan to deploy your ASP.NET application over BMW’s intranet. The application uses data retrieved from a Microsoft SQL Server database. You want to use SQL Server connection pooling to optimize performance. You also need to protect confidential data stored on the server while minimizing administrative costs.
You need to configure security for your application. What should you do?
A. Use Microsoft Windows authentication in the application.Enable impersonation for users to access the SQL Server database from your application.
B. Use Microsoft Windows authentication in the application.Use a single Windows account for users to access the SQL Server database from your
application.
C. Use form-based authentication in the application.Use the system administrator (sa) SQL Server login for users to access the SQL Server database from your application.
D. Use form-based authentication in the application.Assign each user a separate SQL Server login to use to access the SQL Server database from
your application.
Answer: B

You are creating an order entry application named TestKiEntry. You set Orders.aspx as the start page. You want users to log on to Orders.aspx by supplying a user name and password.You create a Login.aspx page to validate the user name and password.You need to ensure that users log on by using Login.aspx before they are allowed to access Orders.aspx. Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. In the authentication section of the Web.config file, set the mode attribute of the authentication element to Forms.Set the name attribute of the forms element to Login.aspx.
B. In the authentication section of the Web.config file, set the mode attribute of the authentication element to Forms.Set the loginUrl attribute of the forms element to Login.aspx.
C. In the authorization section of the Web.config file, set the users attribute of the deny element to “?”:
D. In the credentials section of the Web.config file, set the users attribute of the deny element to “?”.
E. In the credentials section of the Machine.config file, set the users attribute of the deny element to “*”.
F. In the authorization section of the Machine.config file, set the mode attribute of the authentication element to Forms.Set the policyFile attribute of the trust element to Login.aspx.
G. Create a Page directive in Orders.aspx to load the Login.aspx page.
Answer: B, C

You create an ASP.NET application. The application uses integrated security to retrieve information from a Microsoft SQL Server database named BMWSalesOrder. You need to provide a connection string for the application to use to connect to BMWSalesOrder. You decide to store the connection string in the Web.config file.How should you set up the Web.config file?
A. In the configuration section, create an element named appSettings.Create and add element that has a key attribute set to SQLConnection, and a value attribute set to the connection string.
B. In the configuration section, create an element named SQLConnection.Create a key element that has a value attribute set to the connection string.
C. In the authorization section, create an element named SQLConnection.Create a key element that has a value attribute set to the connection string.
D. In the authentication section, create an element named appSettings.Create an element named SQLConnection that has a value attribute set to the connection
string.
Answer: A

You are configuring your ASP.NET application BMWApp. BMWApp will be hosted on a Web server that also runs other applications.You want to prevent any changes to the configuration settings of your application after the application is deployed.What should you do?
A. In the Machine.config file, set the allowOverride attribute in the location element to False.Make no other changes to the Machine.config file.
B. In the Web.config file, set the allowOverride attribute in the location element to False.Make no other changes to the Web.config file.
C. In the Machine.config file, set the allowOverride attribute in the appSettings element to False.Make no other changes to the Machine.config file.
D. In the Web.config file, set the allowOverride attribute in the appSettings element to False.Make not other changes to the Web.config file.
Answer: B

You are configuring security for your ASP.NET application. The folders for your pages are located in a hierarchy as shown in the exhibit.You need to allow all uses to access pages located in the Products folder and the Orders folder.You need to allow any members of the Accounting role to access pages located in the Accounting folder.What are two possible waves achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Add code to the Global.asax file to dynamically configure access to the Accounting folder.
B. Place the authorization settings for all roles in the Web.config file located in the Products folder.Use the location tag in the Web.config file to deny access to the Accounting folder for all roles except the Accounting role.
C. Place the authorization settings for all roles in the Web.config file located in the Products folder.
Allow access for only members of the Accounting role in the Web.config file located in the Accounting folder.
D. Create two custom roles in the Machine.config file for the application.Configure one role for all users, and one role for the Accounting users.
Deny access to the Accounting folder for all users except members of the Accounting role.
Answer: B, C

You create an ASP.NET application that will be sold to BMW’s corporate customers. The corporate customers will buy your application and run it on their intranets.You create a Web setup project for your application and add it to your ASP.NET solution. You also add a file named Readme.txt to the Web setup project.You create the deployment package and install it on a test server. You notice that the deployment package installed Readme.txt in the Web application folder. You want the deployment package to add a shortcut to Readme.txt to the desktop on the server computer.What should you do?
A. Add Readme.txt to your solution and rebuild the deployment package.
B. Select Readme.txt in the Web setup project.
Change the TargetName property to DESKTOP\Readme.txt.
C. In the Web setup project, add the User’s Desktop folder to the File System on Target Machine node.Add a shortcut to Readme.txt in the User’s Desktop folder.
D. In the Web setup project, add a custom folder to the File System on Target Machine node.Name the folder Server Desktop and add a shortcut to Readme.txt in that folder.
Answer: C

As a software developer at BMW you create an ASP.NET application for online ordering.You need to store a small amount of page-specific information on pages that are submitted to the server. This information does not need to be secured. The page must work properly for browsers that do not support cookies. You anticipate that the volume of orders on the site will be high, and you need to conserve server resources.What should you do?
A. Store the information in application state variables.
B. Store the information in session state variables.
C. Store the information in a Microsoft SQL Server database.
D. Store the information in hidden fields on the page.
Answer: D

You create an assembly to access data in a relational database named BMWData. This assembly will be used by several ASP.NET applications on your Web server.
You need to ensure that all your applications can access the assembly. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Run the Assembly Registration tool (Regasm.exe).
B. Run the String Name tool (Sn.exe).
C. Run the Installer tool (Installutil.exe).
D. Run the Global Assembly Cache tool (Gacutil.exe).
Answer: B, D

You create an ASP.NET application that is deployed on BMW’s intranet. Sales representatives use this application to connect to a database while they are speaking to customers on the telephone. Your code is running under the security context of the user who requested the page.The application requires each sales representative to supply a unique user name and password to access the application. These individual user names and passwords are included in the
ConnectionString property settings that your code uses to connect to the database. All users have the same access rights to the database.Sales representatives report that it takes a long time to access the database. You test the application and discover that a new connection is created each time a sales representative connects to the database.You want to reuse connections in order to reduce the time it takes to access the database.What should you do?
A. Modify the connection string to specify Windows Integrated authentication.
B. Modify the connection string to increase the connection timeout setting.
C. Modify the connection string so that is uses a single application user name and password for every connection to the database.
D. Modify the connection string so that is uses a login user named that is a member of the sysadmin fixed server role.
Answer: C

You are creating an ASP.NET page for a travel service. The page contains a CheckBoxList control that contains travel destinations. Customer can select favorite destinations to receive weekly e-mail updates of travel packages.The CheckBoxList control is bound to a database table of possible destinations. Each destination is ranked according to its popularity. You modify the page to sort the destination list by rank, from the most popular to the least popular. The list has three columns.You want the most popular destination to be on the top row of the check box list at run time.Which property setting should you use for the CheckBoxList control?
A. Set the RepeatDirection property to Vertical.
B. Set the RepeatDirection property to Horizontal.
C. Set the RepeatLayout property to Flow.
D. Set the RepeatLayout property to Table.
Answer: B

You are creating an ASP.NET page for BMW’s Web site. Customers will use the ASP.NET page to enter payment information.You add a DropDownList control named cardTypeList that enables customers to select a type of credit card. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the cardTypeList control.You want the page validation to fail if a customer does not select a credit card type from the
list.What should you do?
A. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList.Set the InitialValue property of the RequiredFieldValidator control to Select.
B. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList.Set the DataTextField property of the cardTypeList control to Select.
C. Add a CustomValidator control and set its ControlToValidate property to cardTypeList.Set the DataTextField property of the cardTypeList control to Select.
D. Add a RegularExpressionValidator control and set its ControlToValidate property to cardTypeList.Set the ValidateExpression property of the RegularExpressionValidator control to !Select.
Answer: A

You are a Web developer for BMW Publishing. You are performing a migration of your company’s ASP-based Web page named Booklist.asp to ASP.NET. You want to deploy the ASP.NET version of your Web page with the minimum amount of development effort. You also want the migration to be accomplished as quickly as possible. The page contains a COM component named BMW.BookList. The component is written in Microsoft Visual Basic 6.0. When you open the new page, you receive the following error message: “Server error – The component ‘BMW.BookList’ cannot be created.”  You need to ensure that you can open the Web page successfully.What should you do?
A. Write a manage component to perform the tasks that the Lucerne.BookList component currently performs.
B. Set the AspCompat attribute of the Page directive to true.
C. Add the following line of code to the Page.Load event handler:RegisterRequiresPostBack(“BMW.BookList”;
D. Add the following attribute to the processModel element of the Web.config file:comImpersonationLevel = Delegate
Answer: B.

Your ASP.NET application BMWApp displays sales data on a page. You want to improve performance by holding the page in memory on the server for one hour. You want to ensure that the page is flushed from memory after one hour, and that the page is re-created when the next request for the page is received.What should you do?
A. Initialize a new instance of the Cache class in the Application.Start event handler.
B. Initialize a new instance of the Timer class in the Page.Load event handler.
C. Set the Duration attribute of the OutputCache directive in the page.
D. In the Web.config file, set the timeout attribute of the sessionState element.
Answer: C

You create an ASP.NET application that contains confidential information. You use formbased authentication to validate users. You need to prevent unauthenticated users from accessing the application.What should you do?
A. Set a Page directive in the start page of your application to redirect users to a login page.
B. Set a Page directive in the start page of your application to disallow anonymous users.
C. In the authorization section of the Machine.config file, set the users attribute to the allow element to “?”.
D. In the authorization section of the Web.config file, set the users attribute of the deny element to “?”.
Answer: D

You are creating an ASP.NET application for BMW. Users will use the application to produce reports. The data for the application is stored in a Microsoft SQL Server 2000 database named BMWSrv.You expect many users to use the application simultaneously. You want to optimize the response time when the users are retrieving data for the reports.You create a procedure to retrieve the data from the database. You store a valid connection string in a variable named connString in the procedure.You need to add code to the procedure to connect to the database.Which code segment should you use?
A. OleDb.OleDbConnection cnn = new OleDb.OleDbConnection(connString);
B. SqlClient.SqlConnection cnn = new SqlClient.SqlConnection(connString);
C. ADODB.Connection cnn = new ADODB.Connection();
D. SQLDMO.Database cnn = new SQLDMO.Database();
Answer: B

You create an ASP.NET application for an insurance company BMW Insurance. The application is used to generate automobile insurance quotes. One page in the application allows the user to enter a vehicle identification number (VIN). The page provides manufacturing information on the identified vehicle, and that information is used in rating the vehicle for insurance.The only control on the page is a TextBox control for entering the VIN. You define an event handler for the change event of the TextBox control. The event handler performs the vehicle lookup in the database. The AutoPostBack attribute of the TextBox control is set to True.During testing, you attempt to browse to the page by using Internet Explorer on one of your test computers. You discover you do not receive vehicle information after entering a valid VIN and using the TAB key to move out of the text box. This problem does not occur when you use other test computers that are running Internet Explorer.What should you do?
A. Configure Internet Explorer to allow scripting.
B. Configure Internet Explorer to allow page transitions.
C. In the Page directive, set the SmartNavigation attribute to “True”.
D. In the Page directive, set the AutoEventWireup attribute to “True”.
Answer: A

You are creating an ASP.NET page that enables users to select a country and view information on tourist attractions in that country. Users select a country from a list box named countryList.The list box displays country names. The list box also contains hidden country codes.Your code retrieves a cached DataTable object that contains tourist attraction descriptions and a numeric country code named CountryID. The DataTable object is named attractionsTable.You want to extract an array of DataRow objects from the DataTable object. You want to include tourist attractions for only the selected country.Which code segment should you use?
A. DataRow[] result = attractionsTable.Select(“CountryID = “ + countryList.SelectedItem.Text);
B. DataRow[] result = attractionsTable.Select(“CountryID = “ + countryList.SelectedItem.Value);
C. DataRow result =attractionsTable.Rows.Find(“CountryID = “ + countryList.SelectedItem.Value);
D. DataRow result =attractionsTable.Rows.Find(countryList.SelectedItem.Value);
Answer: B

You are creating an ASP.NET application for an insurance company BMW Insurance. The company will use your ASP.NET application to record insurance claims.
Another development team creates a redistributable component that will be used by your ASP.NET application. The component requires several registry entries to be created during installation so that the component will run properly. The same component might be used by other ASP.NET applications in the future.
The development team gives you the source code to the component as well as all of the project files for the component. You add the component project to your ASP.NET application.You need to create a deployment package for your application. You want to include the redistributable component with your deployment package.What should you do?
A. Create a setup project for the redistributable component.Create a Web setup project for your ASP.NET application.
B. Create a merge module project for your ASP.NET application.Create a setup project for redistributable component and add the merge module for your ASP.NET application to the project.
C. Create a merge module project for both your ASP.NET application and the redistributable component.
Create a Web setup project and add both merge modules to the project.
D. Create a merge module project for the redistributable component.Create a Web setup project for your ASP.NET application and add the merge module for the redistributable component to the project.
Answer: D

You are creating an ASP.NET application. The application will be deployed on BMW’s intranet. BMW uses Microsoft Windows authentication.You want the application to run in the security context of the user.What should you do?
A. Add the following element to the authentication section of the Web.config file:<allow users=”?”/>
B. Add the following element to the system.web section of the Web.config file:<identity impersonate=”true”/>
C. Use the Configuration Manager for your project to designate the user’s security context.
D. Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user’s security context.
Answer: B

You write code to perform a standard financial calculations that are required by BMW.The code accepts input parameters such as interest rate and investment amount. It then calculates values based on different predetermined scenarios.You want to create a control that encapsulates this functionality. You want to be able to easily use this control by dragging it from the toolbox onto your Web forms. You also plan to include full support for visual design tools.
You want to create a project to test the control.Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. Create a Web user control.
B. Create a Web custom control.
C. Create a new Web Form project.Use the COM Components tab of the Customize Toolbox dialog box to specify the new control.
D. Create a new Web Form project.Use the .NET Framework Components tab of the Customize Toolbox dialog box tospecify the new control.
E. Create a new Web Form project.Select Add Reference from the Project menu and browse to the new control.
Answer: B, D

You are creating an ASP.NET application that will be published in several languages. You develop a satellite assembly that will include the localized resources for one of the other languages. The satellite assembly will also contain code that accesses Enterprise Services.BMW has a build team that is responsible for compiling and publishing all software applications created by your group. The build team is also responsible for digitally signing the
software with a public/private key pair.The build team permits you to have access to BMW’s public key, but not the private key. In order to test your localized satellite assembly, you need to digitally sign the assembly.What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Create a test certificate for your satellite assembly by using the Software Publisher Certificate Test tool (Cert2spc.exe).
B. Compile the satellite assembly by using the Resource File Generator (Resgen.exe) with the /compile switch.
C. Compile the satellite assembly by using the Assembly Linker (Al.exe) with the /delay+switch.
D. Use the Global Assembly Cache tool (Gacutil.exe) to install the assembly in the global assembly cache.
E. Generate a new public/private key pair by using the Strong Name tool (Sn.exe).Use the new key pair to sign the assembly temporarily for testing purposes.
Answer: C, E

You are creating a Web Form for BMW’s human resources department. You create a Web user control named Employee that allows the user to edit employee information. Each instance of the control on your Web Form will contains information about a different employee.You place the Employee control on the Web Form and name the control TK1. You also add the Employee control to the ItemTemplate of a Repeater control named repeaterEmployees.Each Employee control in repeaterEmployees contains several TextBox controls. You want your Web Form to handle TextChanged events that are raised by these TextBox controls.
Which event handler should you use?
A. private void TK1_TextChanged(object source,EventArgs e)
B. private void repeaterEmployees_ItemDataBound(object source,RepeaterItemEventArgs e)
C. private void repeaterEmployees_DataBinding(object source,RepeaterItemEventArgs e)
D. private void repeaterEmployees_ItemCommand(object source,RepeaterCommandEventArgs e)
Answer: B

Your ASP.NET application enables customers to create new sales orders. The sales orders are stored in a Microsoft SQL Server database table named BMWSales. The table has an IDENTITY column named OrderID.Your code uses a DataTable object to manage the order data. The DataTable object contains a column named OrderNumber. You use the Update method of a SqlDataAdapter object to call a stored procedure that inserts each new order into the database. The stored procedure uses a parameter to return the new OrderID value for each order.You assign a SqlCommand object to the InsertCommand property of the SqlDataAdapter
object. You add a SqlParameter object to the Parameters collection of the SqlDataAdapter object, specifying the name and data type of the parameter.
You need to set properties of the SqlParameter object to retrieve new OrderID values from the database into the OrderNumber column of your DataTable object.
What should you do?
A. Set the Direction property to ParameterDirection.ReturnValue. Set the SourceColumn property to “OrderID”.
B. Set the Direction property to ParameterDirection.ReturnValue. Set the SourceColumn property to “OrderNumber”.
C. Set the Direction property to ParameterDirection.Output. Set the SourceColumn property to “OrderID”.
D. Set the Direction property to ParameterDirection.Output. Set the SourceColumn property to “OrderNumber”.
Answer: D

You are using your computer to debug and ASP.NET application. Your login account has administrative permissions for your computer. The application contains several existing ASP pages that use server-side scripts. These server-side scripts are written in Microsoft Visual Basic Scripting Edition.You locate a line of VBScript code in an existing ASP page that might be incorrect. You add a breakpoint on the line. When you run the application, everything appears to work properly,but the breakpoint is not invoked. When you examine the breakpoint in the VBScript code, you see the following ToolTip: “The breakpoint will not currently be hit. No symbols have been loaded for this document.”You want the breakpoint to be invoked when you run the application in Debug mode.What should you do?
A. Open the Configuration Manager and set the Active Solution Configuration option to Debug.
B. Select the ASP page in Solution Explorer.Set the Build Action property to Compile.
C. Open the property pages for the ASP.NET application and select the Enable ASP Debugging check box.
D. Select Options from the Tools menu.Select the Debugging folder.In the General category, select the Insert breakpoints in Active Server Pages for breakpoints in client script check box.
Answer: C

You company’s project team develops an order fulfillment ASP.NET application. The application is hosted on a single server named BMW1.You are responsible for verifying and correcting problems identified by the quality assurance team. The quality assurance team reports that freight costs are not being calculated accurately.You need to replicate the problem in order to resolve it.You attempt to use the interactive debugger from your client computer to step through the
ASP.NET application code on BMW1. You are not able to initiate a debugging session, and the following entry is added to the Application event log on your computer: “DCOM got error ‘General access denied error’ from the computer BMW1 when attempting to activate the server.” You need to enable remote debugging.
What should you do?
A. Add your user account to the Power Users group on your client computer.
B. Add your user account to the Power Users group on BMW1.
C. Add your user account to the Debugger Users group on your client computer.
D. Add your user account to the Debugger Users group on BMW1.
Answer: D

You are maintaining an ASP.NET application named BMWSalesForecast. The application is written in Visual C# .NET. The application includes a page named FirstQuarter.aspx that resides within the Sales namespace. The page class is named FirstQuarter.You discover that another developer inadvertently deleted the Page directive for FirstQuarter.aspx. You want to create a new Page directive to allow FirstQuarter.aspx to work properly.Which directive should you use?
A. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” Inherits=”FirstQuarter”%>
B. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” ClassName=”Sales.FirstQuarter”%>
C. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs”> Inherits=”Sales.FirstQuarter”%>
D. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” ClassName=”Sales.FirstQuarter”Inherits=”FirstQuarter”%>
Answer: C

You create an ASP.NET application to display sales analysis information for BMW. A page named TkSalesSummary.aspx displays three separate sections of information.For each section, you write code that calls a stored procedure in a database. The code for each section calls a different stored procedure. After the stored procedure runs, the results are immediately written in HTML format to the Response object for the application.You do not want users to wait until the results are returned from all three stored procedures before they begin to receive content rendered in their browser. What are two possible ways to
achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Set the SuppressContent property of the Response object to False.
B. Set the BufferOutput property of the Response object to False.
C. Set the CacheControl property of the Response object to Public.
D. Insert the following statement after each section is written to the Response object for the application:Response.Clear();
E. Insert the following statement after each section is written to the Response object for the application:Response.ClearContent();
F. Insert the following statement after each section is written to the Response object for the application:Response.Flush();
Answer: B, F

You create an ASP.NET page named Location.aspx. Location.aspx contains a Web user control that displays a drop-down list box of counties. The Web user control is named CountyList and is defined in a file named CountyList.ascx. The name of the DropDownList control in CountyList.ascx is TKCounty.You try to add code to the Page.Load event handler for Location.aspx, but you discover that you cannot access TKCounty from mode in Location.aspx. You want to ensure that code within Location.aspx can access properties of TKCounty.What should you do?
A. In the code-behind file for CountyList.ascx add the following line of code: protected DropDownList TKCounty;
B. In the code-behind file for CountyList.ascx, add the following line of code: public DropDownList TKCounty;
C. In the code-behind file for Location.aspx, add the following line of code: protected DropDownList TKCounty;
D. In the code-behind file for Location.aspx, add the following line of code: public DropDownList TKCounty;
Answer: B

You use Visual Studio .NET on your client computer to develop an ASP.NET application on a remote server. The application provides asset management functionality.Another developer at BMW uses Visual C# .Net to develop a custom component named AssetManagement. Your ASP.NET application uses this custom component. The AssetManagement component defines an Asset class that exposed a public method named DepreciateAssets(). You deploy AssetManagement to the remote server that hosts your ASP.NET application. You also add the source files of AssetManagement to your ASP.NET application.You are debugging an .aspx page in your application by using the Visual Studio .NET interactive debugger. The code in the page creates an instance of the Assets class and then calls
the DepreciateAssets() method of that instance.You attempt to step into a call to the DepreciateAssets() method. Instead of showing the first line of code in the DepreciateAssets() method, the interactive debugger moves to the next line of code in the .aspx page.You need to enable the interactive debugger to step into the code within the Assets class.What should you do in Visual Studio .NET?
A. Configure Visual Studio .NET to enable just-in-time debugging for native programs.
B. Configure Visual Studio .NET to allow editing of Visual C# files while debugging.
C. In the Configuration Manager, select the Debug configuration and rebuild the AssetManagement component.
D. In the Configuration Manager, select the Debug configuration and rebuild the ASP.NET application.
Answer: C

You create an ASP.NET application named Inventory. This application will be used by customers on the Internet.During the beta test period, you ensure that the actual ASP.NET error message is displayed whenever an error is encountered. Both developers and beta testers see the actual text of the error message.
You perform beta testing of other applications on the same beta test server during the beta testing period for Inventory. All of the other applications display ASP.NET error messages.After the beta testing period is complete, the beta test server is promoted to a production server. You want all applications to display a single, user-friendly error message.You want to configure Inventory and the production server to meet these goals. You want to perform this task by using the minimum amount of administrative effort.Which two actions should you take? (Each correct answer presents part of the solution. Choose
two)
A. Set the mode parameter of the customErrors element in the Web.config file for Inventory to “On”.
B. Remove the customErrors element from the Web.config file for Inventory.
C. Set the mode parameter of the customErrors element in the Inventory.config file to “On”.
D. Remove the customErrors element from the Inventory.config file.
E. Set the mode parameter of the customErrors element in the Machine.config file to “On”.
F. Remove the customErrors element from the Machine.config file.
Answer: B, E

You create an ASP.NET application for BMW’s purchasing department. A page in the application displays a list of products based on the supplier, the product category, or the price.The URL of the page includes this information as parameters.You want to store multiple versions of your ASP.NET page in the cache based in the parameter values. You want each version of the page to be cached for 300 seconds.You need to add code to the page to accomplish this goal.
Which code segment should you use?
A. Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));Response.Cache.VaryByParams[“?”] = true;
B. Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));Response.Cache.VaryByParams[“All”] = true;
C. Response.Cache.SetCacheability(HttpCacheability.Public);Response.Cache.
SetLastModified(DateTime.Parse(“00:05:00”));Response.Cache.VaryByParams[“All”] = true;
D. Response.Cache.SetCacheability(HttpCacheability.Public);Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));
Response.Cache.VaryByParams[“*”] = true;Answer: D

You create an ASP.NET application for BMW’s intranet. All employee on the intranet use Internet Explorer.A page named UserAccount.aspx contains several controls that require postback to the server for event processing. The event handlers for these controls require access to a database in order to complete their processing.Each time UserAccount.aspx performs a postback, there is a brief period of time in which the browser window is blank while the page is refreshed. The control that had the focus prior to the postback does not have the focus after the page is re-rendered. This factor results in confusion and invalid data entry by some of the users. You need to modify UserAccount.aspx to prevent the browser window from going blank after a postback and to maintain the correct control focus after events are processed. You need to accomplish this task with the minimum amount of development effort.What should you do?
A. Add the following attribute to the HTML code for the controls that cause the postbacks:RunAt=”client”
B. Add the following attribute to the HTML code for the controls that cause the postbacks:EnableViewState=”True”
C. Add the following attribute to the Page directive for UserAccount.aspx:SmartNavigation=”True”
D. Add the following attribute to the OutputCache directive for UserAccount.aspx:Location=”client”
Answer: C

You are creating a shopping cart application for BMW. The application loads the category and product data only once in each user’s session.You create two DataTable objects. One DataTable object is named Categories, and the other DataTable object is named Products. The Categories object remains static, but the Products object is modified when the user selects products and enters quantities to purchase.You want to minimize the time it takes the page to reload after each change.Which pair of statements should you use?
A. Cache[“Categories”] = Categories;Session[“Products”] = Products;
B. Session[“Categories”] = Categories;Cache[“Products”] = Products;
C. Session[“Categories”] = Categories;Session[“Products”] = Products;
D. Cache[“Categories”] = Categories;Cache[“Products”] = Products;
Answer: A.

You create an ASP.NET application for an online insurance site BMW Insurance. A page named VehicleInformation.aspx has the following Page directive:<%@ Page Language=”c#” CodeBehind=”VehicleInformation.aspx.cs” AutoEventWireup=”false” inherits=”InsApp.VehicleInfo”%>
VehicleInformation.aspx had a TextBox control named vehicleIDNumber in which the user can enter a vehicle identification number (VIN). The HTML code for this control is as follows: <asp:TextBox ID=”vehicleIDNumber” Columns=”20” Runat=”server”/> You need to implement a TextChanged event handler for vehicleIDNumber. You want this event handler to retrieve information about a vehicle by using an XML Web service that charges for each access. The page will then be redisplayed with additional information about the vehicle obtained from the XML Web service.
You are implementing the TextChanged event handler.Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. In the Page directive for VehicleInformation.aspx, ensure that the AutoEventWireup attributes is set to “true”.
B. In the Page directive for VehicleInformation.aspx, ensure that the EnableViewState attribute is set to “true”.
C. In the vehicleIDNumber HTML element, ensure that the AutoPostback attribute is set to “false”.Include code for the client-side onserverchange event to submit the Web Form for processing by the server.
D. In the vehicleIDNumber HTML element, ensure that the AutoPostback attribute is set to “true”.Include code in the TextChanged event handler to query the XML Web service.
Answer: B, D

You are creating an ASP.NET application for BMW. The company deploys an XML Web service that returns a list of encyclopedia articles that contain requested keywords.You want to create a class that calls the XML Web service.What should you do?
A. Select Add Web Service from the Project menu in Visual Studio .NET and browse to the XML Web service.
B. Select Add Reference from the Project menu in Visual Studio .NET and browse to the XML Web service.
C. Select Add Web Reference from the Project menu in Visual Studio .NET and browse to the XML Web service.
D. Run the Type Library Importer (Tlbimp.exe) and provide it with the URL for the XML Web service.
E. Run the Web Services Discover tool (Disco.exe) and provide it with the URL for the XML Web service.
Answer: C

You create an ASP.NET application named TKApp. You create an assembly named TKApp.dll in a directory named TKDir. The assembly includes a default resource file named strings.resources that adequately support English-speaking users of the application. You create an additional resource file named strings.ja.resources to enable support for Japanese-speaking users. The resource file is located in the TKDir/ja subdirectory. You want to create a satellite
assembly for TKApp.dll that will use the new resource file.What should you do?
A. Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.Place the output assembly in TKDir.
B. Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.Place the output assembly in TKDir/ja.
C. Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.Place the output assembly in TKDir.
D. Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.Place the output assembly in TKDir/ja.
Answer: B

As a software developer at BMW you are creating an ASP.NET application that will display facts about the solar system. This application will support localization for users from France,Germany, Japan, and the United States. To see information about a particular planet, the user will select the planet from a drop-down list box on SolarSystem.aspx.You want to display the planet names in the drop-down list box in the language appropriate to the individual who is using the application.What should you do?
A. Create a database table named Planets.Create three column named PlanetID, LocaleID, and Description.Use SqlCommand.ExecuteReader to query the table for the locale specified in the request.Using the locale specified in the request, translate the values by using the TextInfo.OEMCodePage property.Populate the drop-down list box with the translated text.
B. Create a DataTable object named Planets.Populate the Planets DataTable object by using string constants.Using the locale specified in the request, translate the values by using a UnicodeEncoding object.Bind the DataSource property of the drop-down list box to the DataTable object.
C. Create a database table named Planets.Create two columns named PlanetID and Description.Use a SqlDataAdapter to load the planet information into a DataSet object.Using the locale specified in the request, use the String format provider to translate the values.Bind the DataSource property of the drop-down list box to the DataSet.DefaultView object.
D. Create string resources assemblies for each locale.Using the locale specified in the request, use a ResourceManager to load the appropriate assembly.Populate an array with the string values from the assembly.Bind the DataSource property of the drop-down list box to the array.
Answer: D

You are creating an ASP.NET page for BMW. The page contains a DataGrid control that displays all the current prices for the commodities that BMW purchases. The page also contains a Button control that refreshes the data in the DataGrid control.The DataGrid control needs to be repopulated each time the page is displayed. The data is accessed through a DataView object stored in the Session object. You want to ensure the fastest load time for the page.What should you do?
A. Set the DataSource property and call the DataBind method of the DataGrid control in the Click event handler for the Button control.
B. Set the DataSource property and call the DataBind method of the DataGrid control in the Start event handler for the Session object.
C. Set the EnableViewState property of the DataGrid control to false.
D. Set the EnableViewState property of the DataGrid control to true.
Answer: C

You create an ASP.NET application named TestKApp for BMW’s intranet. TestKApp stores static data in a flat file. The file is located in a separate directory on the Web server. You want to allow only your application to access this directory.TestKApp uses Microsoft Windows authentication. The application runs successfully on your computer. However, when TestKApp is deployed to the test server, testers report a permission error when the application attempts to access the flat file.You need to ensure that the application can load the data from the flat file. You want to prevent users from using the file system to read the file.What should you do?
A. Add the following element to the authorization section of the Web.config file: <identity impersonate=”true”/>
B. Add the following element to the system.web section of the Web.config file: <allow users=”system”/>
C. Grant the ASPNET account Read permission on the directory where the file is located.
D. In the Machine.config file, set the userName attribute in the processModel section to “system”.
Answer: C

You develop a contact management application that will enable users to retrieve information from a central database. After the data is returned to your application, users must be able to view it, edit it, add new records, and delete existing records. All user changes must then be saved in the database.
Your application design requires several ADO.NET object to work together to accomplish these requirements. You use classes from the System.Data and System.Data.OleDb namespaces.First you write the code to connect to the database.Which four actions should you take next? (Each correct answer presents part of the solution.Choose four)
A. Create an OleDbDataAdapter object and define the SelectCommand property.
B. Create an OleDbCommand object and use the ExecuteScalar method.
C. Create a DataTable object as container for the data.
D. Create a DataSet object as a container for the data.
E. Call the DataAdapter.Fill method to populate the DataSet object.
F. Call the DataAdapter.Update method to populate the DataSet object.
G. Call the DataAdapter.Update method to save changes to the database.
H. Call the DataSet.AcceptChanges method to save changes to the database.
Answer: A, D, E, G

You create an ASP.NET application named TimeSheet for BMW’s intranet. The application will be used only by employees of your company.You want the application to recognize the user without forcing the user to enter a name and password. You write the following code to save the user’s Microsoft Windows login name in
the Session object: Session.Item(“User”)=User.Identity.Name; When you run the TimeSheet, the Session.Item(“User”) variable returns an empty string.You want to configure Internet Information Services (IIS) and your application to be able to retrieve the user name automatically.What should you do?
A. Disable Anonymous Access for the application in IISB.Enable Basic authentication for the application in IIS
C. Add the following element to the Web.config file for TimeSheet:<identity impersonate=”True” />
D. Add the following element to the Web.config file for TimeSheet:<identity impersonate=”False” />
Answer: A

You create an ASP.NET application for a hotel. The application contains a page that displays current weather conditions for the city in which the hotel is located. The application calls an XML Web service every 10 minutes to update the current weather conditions. A new page is then displayed for subsequent requests.You want the same page to be cached and retrieved from the cache during the time between calls to the XML Web service. You decide to use a Page directive to accomplish this goal.Which page directive should you use?
A. <%@ Cache Seconds=”600” VaryByParam=”page” %>
B. <%@ OutputCache Time=”600” %>
C. <%@ OutputCache Duration=”600” VaryByParam=”None” %>
D. <%@ OutputCache Duration=”600” %>
Answer: C

You deploy and ASP.NET application. When an error occurs, the user is redirected to a custom error page that is specified in the Web.config file.
Users report that one particular page is repeatedly generating errors. You need to gather detailed error information for the page. You need to ensure that users of the application continue to see the custom error page if they request pages that generate errors.What should you do?
A. In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly and access the page from a browser on your client computer.
B. In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly and access the page from a browser on the server.
C. Modify the Page directive so that the Trace attribute is set to True and the LocalOnly attributes is set to true, and then access the page from a browser on the server.
D. Modify the Web.config file to include the following element: <trace enabled=”true” LocalOnly=”false” PageOutput=”true”/>Access the application from a browser on your client computer.
Answer: B

You create an ASP.NET application named TKProject on your client computer. The application has a page named ProjectCalendar.aspx. This page is located in a virtual directory named Scheduling, which is a child of the TKProject root directory. ProjectCalendar.aspx uses cookies to track modifications to the schedule during a user’s session so that the user can undo modifications if necessary.You deploy your application on a computer named BMWSrv. Users report that the undo functionality stops working after they execute a specific sequence of actions. You need to view the cookie values after the sequence of actions to help identify the cause of the problem.You add the following element to the Web.config file: <trace enabled=”true” pageOutput=”false”/> You want to display the trace output information on your client computer.Which URL should you use?
A. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx?Trace=true
B. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx?trace.axd
C. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx
D. HTTP://BMWSrv/TKProject/ProjectCalendar.aspx?trace.axd
E. HTTP://BMWSrv/TKProject/ProjectCalendar.aspx?trace.axd
F. HTTP:// BMWSrv/TKProject/trace.axd
Answer: F

You are creating an ASP.NET application for BMW. Customers will use the application to file claim forms online.You plan to deploy the application over multiple servers. You want to save session state information to optimize performance.What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Modify the Web.config file to support StateServer mode.
B. Modify the Web.config file to support SQLServer mode.
C. Modify the Web.config file to support InProc mode.
D. In the Session_Start procedure in the Global.asax file, set the EnableSession property of the WebMethod attribute to true.
E. In the Session_Start procedure in the Global.asax file, set the Description property of the WebMethod attribute to sessionState.
Answer: A, B
You are creating an ASP.NET application for BMW’s Internet Web site. You want to create a toolbar that will be displayed at the top of each page in the Web site. The toolbar will contain only static HTML code. The toolbar will be used in only your application.Your plan to create the toolbar as a reusable component for your application. You need to create the toolbar as quickly as possible.What should you do?
A. Create a new Web Control Library project.
Create the toolbar within a Web custom control.
B. Add a new Web user control to your ASP.NET project.
Create the toolbar within the Web user control.
C. Add a new Web Form to your ASP.NET project.Use HTML server controls to design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D. Add a new component class to your ASP.NET project.Use HTML server controls to design the toolbar within the designer of the component class.
Answer: B

You are creating an ASP.NET page for BMW. You create a DataGrid control that displays past purchases made by the user. The DataGrid control is populated from an existing database when the page is created.The page contains TextBox controls that allow users to update their personal information, such as address and telephone number.You need to ensure that the page is refreshed as quickly as possible when users update their contact information.What should you do?
A. Set the Enabled property of the DataGrid control to false.
B. Set the EnableViewState property of the DataGrid to false.
C. Write code in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is false.
D. Write in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is true.
Answer: D

You create a new ASP.NET application named TestKSalesReports on your development computer. You add code to the default WebForm1. To test the code’s functionality, you copy the entire TestKSalesReports folder from the C:\inetpub\wwwroot folder on your computer to the C:\inetpub\wwwroot folder on a separate Microsoft Windows 2000 Server computer named BMW1. BMW1 hosts several ASP.NET applications.When you use the browser on your computer to open the copy of the application hosted on BMW1, you receive the following error message: “It is an error to use a section registered as allowDefinition=”MachineToApplication’ beyond application level.” You want to correct this error without altering the other Web sites that are hosted on BMW1.What should you do?
A. Use Internet Information Services (IIS) to create a virtual directory that points to the TestKSalesReports folder on BMW1.
B. Remove the following element from the Web.config file in C\inetpub\wwwroot\TestKSalesReports on BMW1:<authentication mode=”Windows” />
C. Remove the following element from the Web.config file in C:\inetpub\wwwroot on BMW1:<authentication mode=”Windows” />
D. Move the TestKSalesReports folder on BMW1 up one level, so that it is a subfolder of the inetpub folder.
Answer: B

You create an ASP.NET page named BMWCalendar.aspx that shows scheduling information for projects in your company. The page is accessed from various other ASP and ASP.NET pages hosted throughout the company’s intranet. All employees on the intranet use Internet Explorer.BMWCalendar.aspx has a Calendar control at the top of the page. Listed below the Calendar control is detailed information about project schedules on the data selected. When a user selects a date in the calendar, the page is refreshed to show the project schedule details for the newly selected date.Users report that after viewing two or more dates on BMWCalendar.aspx, they need to click the browser’s Back button several times in order to return to the page they were viewing prior to accessing BMWCalendar.aspx.You need to modify BMWCalendar.aspx so that the users need to click the Back button only once.What should you do?
A. Add the following statement to the Page.Load event handler for BMWCalendar.aspx:Response.Expires(0);
B. Add the following statement to the Page.Load event handler for BMWCalendar.aspx:Response.Cache.SetExpires (DateTime.Now());
C. Add the following attribute to the Page directive for BMWCalendar.aspx:EnableViewState=”True”
D. Add the following attribute to the Page directive for BMWCalendar.aspx:SmartNavigation=”True”
Answer: D

You are creating a new ASP.NET page named ItemList that displays item and price information for many different items. When a user logs on to the Web site, the page retrieves the current list of prices from a database. ItemList will be accessed by several thousand registered users.When a price list is retrieved for a user, the prices remain valid for as long as the user continues to access the page. Users are allowed to keep the same price list for several days.
When ItemList is posted back to the server, you want to ensure that the price list was not altered on the user’s computer. You also want to minimize the memory resources consumed on the Web server.Which three parameters should you add to the Page directive in ItemList? (Each correct
answer presents part of the solution. Choose three)
A. EnableSessionState=”True”
B. EnableSessionState=”False”
C. EnableSessionState=”ReadOnly”
D. EnableViewState=”True”
E. EnableViewState=”False”
F. EnableViewStateMac=”True”
G. EnableViewStateMac=”False”
Answer: B, D, F

You create an ASP.NET application named MyApp that will be installed on a Web server named BMWSrv.You create a Web setup project to deploy your ASP.NET application and add it to your solution. You set the Configuration Manager to Release mode and create a deployment package for your application. You copy the deployment package to a CD-ROM and take it to BMWSrv.You log on to BMWSrv and run the deployment package from your CD-ROM. During the setup process, you receive the following error message. “The specified path “http://BMWSrv/MyApp’ is unavailable. The Internet Information Server might not be running or the patch exists and is redirected to another machine. Please check the status of the virtual directory in the Internet Service Manager”.You verify that Internet Information Services (IIS) is running on BMWSrv and that the specified path does not exist. You want to install the application on BMWSrv.What should you do?
A. Launch the deployment package in Administrative mode by using the /a command line option.
B. Log off and log on again by using an account that has Administrator privileges on BMWSrv.
C. Create an ISS virtual directory named MyApp and configure it with Write permissions.
D. Copy the deployment package from the CD-ROM to a local folder on BMWSrv and then run the deployment package.
Answer: C

You create a user control named Address that is defined in a file named Address.ascx. Address displays address fields in an HTML table.Some container pages might contain more than one instance of the Address user control. For example, a page might contain a shipping address and a billing address. You add a public property named TKCaption to the Address user control. The caption property will be used to distinguish the different instances.You want the caption to be displayed in the first <td> element of the table of address fields.You need to add code to the <td> element of the table to display the caption.Which code should you use?
A. <td><%=TKCaption%></td>
B. <td><script runat=”server”>TKCaption</script></td>
C. <td><script>document.write(“TKCaption”);</scripts></td>
D. <td>=TKCaption</td>
Answer: A

You are creating an ASP.NET application called TestKApp that will be used by companies to quickly create information portals customized to their business. TestKApp stored commonly used text strings in application variables for use by the page in your application. You need your application to initialize these text strings only when the first user accesses the application. What should you do?
A. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
B. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.
C. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
D. Include code in the Page.Load event handler for the default application page that sets the values if the text strings when the IsPostback property of the Page object is False.
E. Include code in the Page.Load event handler for the default application page that sets the values of the text strings when the IsNewSession property of the Session object is set to True.
Answer: A

You are creating an ASP.NET application for BMW’s human resources (HR) department.Users in the HR department will use the application to process new employees. The application automates several activities that include creating a network login account, creating an e-mail account, registering for insurance benefits, and other activities.During integration testing of your application, you need to verify that the individual activities run successfully and in the proper order.Each page in your application includes the following elements in the Page directive:Debug=”True” Trace=”True” You want each page to provide execution information in the Web browser immediately after the page’s normal display output. You need to add instrumentation to the code in your pages to
accomplish this goal.Which statement should you use?
A. Trace.Write();
B. Debug.Print();
C. System.Diagnostics.Trace.Write();
D. System.Diagnostics.Debug.Write();
E. System.Diagnostics.Debugger.Log();
Answer: A

You create an ASP.NET application for BMW. The company uses Microsoft Windows authentication. All users are in the BMW domain.You want to configure the application to use the following authorization rules: • Anonymous users must not be allowed to access the application.  • All employees except Tess and King must be allowed to access the application.Which code segment should you use to configure the application?
A. <authorization><deny users=”BMW\tess, BMW\king”><allow users=”*”><deny users=”?”></authorization>
B. <authorization><allow users=”*”><deny users=”BMW\tess, BMW\king”><deny users=”?”></authorization>
C. <authorization><deny users=”BMW\tess, BMW\king”><deny users=”?”><allow users=”*”></authorization>
D. <authorization><allow users=”BMW\tess, BMW\king”><allow users=”*”></authorization>
E. <authorization><allow users=”*”><deny users=”BMW\tess, BMW\king”></authorization>
Answer: C

You create an ASP.NET application named TKProject. You write code to specify the namespace structure of TKProject by including all class declarations within a namespace named TKNamespace. You want to compile TKProject so that the fully qualifies namespace of each class is TKNamespace. You want to prevent the fully qualifies namespace of each class from being TKProject.TKNamespace.You need to make changes in the Common Properties folder of the Property Pages dialog box for TKProject.What should you do?
A. Change the value of the AssemblyName property to TKNamespace.
B. Clear the value of the AssemblyName property and leave it blank.
C. Change the value of the RootNamespace property to TKNamespace.
D. Clear the value of the RootNamespace property and leave it blank.
Answer: D

You are creating an ASP.NET accounting application that stores and manipulates data in a Microsoft SQL Server database named BMWSrv. One of the pages in the application will be used for performing month-end operations to calculate the balance of all accounts.When a user clicks a button on the page, you want your code to run several stored procedures to calculate the month-end balances. These procedures must all succeed before the calculated balances can be stored in the database. If any of the procedures fail, then you do not want to store any of the month-end calculated balances. While the procedures are running, you do not want any users to be able to edit, add, or delete data in the tables affected by the procedures.What should you do?
A. Create a class derived from System.EnterpriseServices.ServicesComponent to run the stored procedures.Annotate the class by using a TransactionAttribute type of attribute.Set the Value property of the attribute to TransactionOption.RequiresNew.
B. Create a master stored procedure.Use this master stored procedure to call the other stored procedures that perform the monthend operations.Add WITH REPEATABLEREAD to the master stored procedure.
C. Use structured exception handling to catch a SqlException if one of the stored procedures fails.Use the Procedure property of the SqlException to identify which stored procedure generated the exception, and call a stored procedure to reserve the previous calculations.
D. Set the IsolationLevel property of a SqlTransaction object to IsolationLevel.Serializable.Assign the SqlTransaction object to the Transaction property of the SqlCommand object.Use a SqlCommand object to run the stored procedures.
Answer: D

You are a Web developer for an online research service BMW Research Inc. You are creating an ASP.NET application that will display research results to users of the BMW Web site.You use a DataGrid control to display a list of research questions and the number of responses received for each question. You want to modify the control so that the total number of responses received is displayed in the footer of the grid. You want to perform this task with the minimum amount of development effort.What should you do?
A. Override the OnPreRender event and display the total when the footer row is created.
B. Override the OnItemCreated event and display the total when the footer row is created,
C. Override the OnItemDataBound event and display the total when the footer row is bound.
D. Override the OnLayout event and display the total in the footer row.
Answer: C

You create an ASP.NET application that will run on BMW’s Internet Web site. Your application contains 100 Web pages. You want to configure your application so that it will display customized error messages to users when an HTTP code error occurs.You want to log the error when an ASP.NET exception occurs. You want to accomplish these goals with the minimum amount of development effort.Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Create an Application_Error procedure in the Global.asax file for your application to handle ASP.NET code errors.
B. Create an applicationError section in the Web.config file for your application to handle ASP.NET code errors.
C. Create a CustomErrors event in the Global.asax file for your application to handle HTTP errors.
D. Create a CustomErrors section in the Web.config file for your application to handle HTTP errors.
E. Add the Page directive to each page in the application to handle ASP.NET code errors.
F. Add the Page directive to each page in the application to handle HTTP errors.
Answer: A, D

BMW is developing an ASP.NET application for producing comparative insurance quotes from multiple insurance carries. BMW wants the application to provide quotes to a user after the user answers questions about individual insurance needs. You deploy a copy of the application to BMW’s testing environment so that you can perform unit testing.The Machine.config file on the testing server contains the following element:<trace enabled=”false” pageOutput=”false”/>
The Web.config file for your application contains the following element:<trace enabled=”false” pageOutput=”false”/>When you run the application, you find that not all insurance carries are being displayed on the quote result page. You attempt to view the trace output information for the quote results page by browsing to the trace.axd URL for your application. No trace information is shown.You want to be able to examine trace output information by using trace.axd. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Modify the element in the Machine.config file as follows:<trace enabled=”true” pageOutput=”false”/>
B. Modify the element in the Machine.config file as follows:<trace enabled=”true” pageOutput=”true”/>
C. Modify the element in the Web.config file as follows:<trace enabled=”true” pageOutput=”false”/>
D. Modify the element in the Web.config file as follows:<trace enabled=”true” pageOutput=”true”/>
E. Modify the Page directive for the quote results page so that it contains the following entry:Trace=”true”
Answer: C, D

You create an ASP.NET application and deploy it on a test server named BMWSrv. The application consists of a main page that links to 30 other pages containing ASP.NET code.You want to accomplish the following goals: • Enable tracing on all the pages in the application except the main page. • Display trace output for up to 40 requests. • Ensure that trace output is appended to the bottom of each of the pages that will
contain trace output. • Ensure that any configuration changes affect only this application.You need to accomplish these goals with the minimum amount of development effort.Which three actions should you take? (Each correct answer presents part of the solution.Choose three)
A. Add the following element to the Web.config file:<trace enabled=”true” pageOutput=”true”/>
B. Add the following attribute to the Trace element of the application’s Web.config file:requestLimit=40
C. Add the following attribute to the Trace element of the application’s Machine.config file:requestLimit=40
D. Set the Trace attribute of the Page directive to true for each page except the main page.
E. Set the Trace attribute of the Page directive to false for the main page.
F. Set the TraceMode attribute of the Page directive to SortByTime for the main page.
Answer: A, B, E

You are a Web developer for BMW. 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 TestK01.The company purchases a factory automation software application. The application is installed on TestK01, 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. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on TestK01.Which string should you use?
A. “Server=TestK01;Data Source=Factory;Initial Catalog=FactoryDB;Integrated Security=SSPI”
B. “Server=TestK01;Data Source=Factory;Database=FactoryDB;Integrated Security=SSP1”
C. “Data Source=TestK01\Factory;Initial Category=Factory;Integrated Security=SSP1”
D. “Data Source=TestK01\Factory;Database=FactoryDB;Integrated Security=SSP1”
Answer: D

You create an ASP.NET application to provide online order processing to BMW customers.A page named ShippingInformation.aspx contains a Web Form with controls for collecting shipping location information. The Web Form contains the following elements:• Four TextBox controls for entry of name, street address, city, and postal code.• A DropDownList control that consists of the full names of 150 countries.• A Button control named shipItButton.
The Click event handler for shipItButton is located in the code-behind file for ShippingInformation.aspx. None of the other controls on the Web Form define server-side event handlers.The Click event handler for ShipItButton redirects the user to a page named ShippingConfirmation.aspx. The ShippingConfirmation.aspx page provides the confirmation status of the shipping request submission to the user.Users who access the application by using dial-up connections report that ShippingInformation.aspx processes very slow after the user clicks the shipItButton. Users on high-bandwidth network connections do not report the same issue.You need to decrease the delay experienced by the dial-up users. What should you do?
A. Add the following attribute to the Page directive for ShippingInformation.aspx:EnableViewState=”False”
B. Add the following attribute to the Page directive for ShippingInformation.aspx:SmartNavigation=”True”
C. Add the following attribute to the OutputCache directive for ShippingInformation.aspx:Location=”server”
D. Add the following attribute to the OutputCache directive for ShippingInformation.aspx.Location=”client”
Answer: A

You are creating an ASP.NET application to track BMW sales orders. The application uses an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders,and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order.What should you do?
A. Add a DataRelation object to the Relations collection of the DataSet object.
B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other.
C. Add a ForeignKeyConstraint to the OrderDetails table.
D. Add a keyref constraint to the DataSet schema.
Answer: A

You ASP.NET application manages order entry data by using a DataSet object named TKorderEntry. The TKorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?
A. The current value of OrderDetails.KeyDeleteRule is Rule.Cascade.
B. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
C. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault.
D. The current value of OrderDetails.KeyDeleteRule is Rule.None.
Answer: D

You are creating an ASP.NET application for BMW. Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine.You need to make the XML Web service available to your application.What should you do?
A. On the .NET tab of the Reference dialog box, select System.Web.Services.dll.
B. In the Web References dialog box, type the address of the XML Web service.
C. Add a using statement to your Global.asax.cs file, and specify the address of the XML Web service.
D. Write an event handler in the Global.asax.cs file to import the .wsdl and .disco files associated with the XML Web service.
Answer: B

You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named requestTKDate. The date must be no earlier than two business days after the order date, and no later that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window, you set the ControlToValidate property to requestTKDate.You need to ensure that the date entered in the requestDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server.What should you do?
A. Set the AutoPostBack property of requestDate to False.Write code in the ServerValidate event handler to validate the date.
B. Set the AutoPostBack property of requestDate to True.Write code in the ServerValidate event handler to validate the date.
C. Set the AutoPostBack property of requestDate to False.Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
D. Set the AutoPostBack property of requestDate to True.Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
Answer: C

You create an ASP.NET application to provide corporate news and information to BMW’s employees. The application is used by employees in New Zealand. Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code: currentDateLabel.Text = DateTime.Now.ToString(“D”) You need to ensure that the data is displayed correctly for employees in New Zealand. What should you do?
A. In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ.
B. In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ.
C. In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8.
D. In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.
Answer: A

You are a member of a team of developers creating several ASP.NET applications for BMW. You want to create a reusable toolbar that will be used in each of the applications.The toolbar will be displayed at the top of each page viewed by the user.The contents of the toolbar will vary depending on options each user selects when creating a profile.You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team.What should you do?
A. Create a new Web Control Library project.Create the toolbar within a Web custom control.
B. Add a new Web user control to your ASP.NET project.Create the toolbar within the Web user control.
C. Add a new Web Form to your ASP.NET project.Design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D. Add a new component class to your ASP.NET project.Design the toolbar within the designer of the component class.
Answer: A

You are creating an ASP.NET application for BMW. The application will be used to identify potential customers.Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine. You want to merge this DataSet object into a DataSet object containing a list of companies that are potential customers.You specify wideWorld as the name of the DataSet object form Wide World Importers, and you specify customerProspects as the name of the DataSet object containing potential customers. After the merge, customerProspects will include the company names in wideWorld.The two DataSet objects contain tables that have the same names and primary keys. The tables in the two DataSet objects contain columns that have the same names and data types. A table in wideWorld also contains additional columns that you do not want to add to customerProspects. If customerProspects included any tables containing rows with pending changes, you want to preserve the current values in those rows when the merge occurs.Which lime of code should you use to merge the wideWorld DataSet object into customerProspects DataSet object?
A. customerProspects.Merge (wideWorld, true,MissingSchemaAction.Ignore);
B. customerProspects.Merge (wideWorld, true,MissingSchemaAction.AddWithKey);
C. wideWorld.Merge (customerProspects, true,MissingSchemaAction.Ignore);
D. wideWorld.Merge (customerProspects, true,MissingSchemaAction.Add);
Answer: A

You are creating an ASP.NET page for selling movie tickets. Users select a region, and then they select from a list of cities in that region. The site displays the names and locations of movie theaters in the city selected by the user.Your company, BMW Brothers, maintains a list of theaters in a database table that includes the city, name, and street address of each theater. You want to minimize the time required to retrieve and display the list of theater names after a user selects the region and city.What should you do?
A. Modify the connection string to add the packet size property and set its values to 8192.
B. Add the following directive to the page:OutputCache VaryByParam=”city”
C. Add the following directive to the page:OutputCache VaryByControl=”region;city”
D. Modify the connection string to keep your database’s connection pool as small as possible.
Answer: B

You are creating an ASP.NET page for BMW. The page uses string concatenation to gather data from multiple e-mail messages and format the data for display on the page.You want to ensure that the page displays as quickly as possible.What should you do?
A. Write code that uses the Append method of the StringBuilder object.
B. Write code that uses the Substring method of the String object.
C. Write code that uses the Concat method of the String object.
D. Write code that uses the plus-sign (+) operator to concatenate the strings.
Answer: A

You create an ASP.NET application that produces sales reports for the BMW corporation.The sales data is stored in a Microsoft SQL Server database that is used for transaction processing. The application consists of complex Transact-SQL statements.Many users report that the report generation is taking longer to run each day. You need to improve response times.What are two possible ways to achieve this goal? (Each correct answer presents a complete
solution. Choose two)
A. Use an OleDbDataAdapter indexes exist on the SQL Server tables.
B. Ensure that appropriate indexes exist in the SQL Server tables.
C. Rewrite your SQL statements to use aliases for all table names.
D. Rewrite your direct SQL statements as stored procedures and call the stored procedures from
your application.
E. Configure queries to run in the security context of the user who is running the query.
Answer: B, D

You create an ASP.NET page that uses images to identify areas where a user can click to initiate actions. The users of the application use Internet Explorer.
You want to provide a pop-up window when the user moves the mouse pointer over an image.You want the pop-up window to display text that identifies the action that will be taken if the user clicks the image.What should you do?
A. For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.
B. For each image, set the ToolTip property to specify the text you want to display.
C. In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.
D. In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.
Answer: B

You create an ASP.NET application. You implement tracing and debugging instrumentation.The application is deployed on BMW’s intranet.After working with the application for several days, users report that some pages are displaying errors that incorrectly identify valid date values as being invalid.You need to gather debugging information from the application while it is running in the production environment. You need to perform this task with the least impact on the performance of the application.What should you do?
A. Enable Debug mode in the application’s Web.config file on the production server.Use Visual Studio .NET on your client computer to select Debug Processes from the Tools menu and attach to the aspnet_wp.exe process on the production server.
B. Enable Debug mode in the application’s Web.config file on the production server.Use Visual Studio .NET on your client computer to open the application project on the production server and select Start from the Debug menu.
C. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server.View the debugging information on the trace.axd page.
D. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server.Run the DbgClr.exe and attach to the aspnet_wp.exe process on the production server.
Answer: A

You are creating an e-commerce site for BMW. Your site is distributed across multiple servers in a Web farm.Users will be able to navigate through the pages of the site and select products for purchase.You want to use a DataSet object to save their selections. Users will be able to view their selections at any time by clicking a Shopping Cart link.You want to ensure that each user’s shopping cart DataSet object is saved between requests when the user is making purchases on the site.What should you do?
A. Create a StateBag object.Use the StateBag object to store the DataSet object in the page’s ViewState property.
B. Use the HttpSessionState object returned by the Session property of the page to store the DataSet object.Use the Web.config file to configure an out-of-process session route.
C. Use the Cache object returned by the page’s Cache property to store a DataSet object for each user.Use an HttpCachePolicy object to set a timeout period for the cached data.
D. Use the Session_Start event to create an Application variable of type DataSet for each session.Store the DataSet object in the Application variable.
Answer: B

You are creating an ASP.NET page for BMW. BMW Employees will use the page to enter suggested names for new products. Each suggestion is saved in a Microsoft SQL Server database. The table in the database for suggestion includes the following three columns.Column name Content EmployeeID identification number of employee making a suggestion ProductID identification number for the product being named Suggestion suggested name for product To add a suggestion to the ASP.NET page, an employee logs on by entering the appropriate EmployeeID and password. The employee then uses a drop-down list box to select a ProductID
and uses a grid to enter suggested names for that product. The employee can enter multiple suggestions for a single products before submitting the page.
The database table has a unique index that includes the EmployeeID, ProductID, and Suggestion columns. The unique index does not allow the same suggested name to be recorded twice for the same product by the same employee.You are using a SqlDataAdapter object to insert the suggestions into the database. If one of the suggested names for a product is a duplicate, the database returns an error to your code. You do not want such errors to interrupts processing. You want your code to continue inserting any remaining suggestions entered by the employee. You also want to be able to access a list of any suggested names that were skipped due to errors.What should you do?
A. Set the SqlDataAdapter object’s ContinueUpdateOnError property to true before calling the object’s Update method.
B. Enclose your call to the SqlDataAdapter object’s Update method in a try/catch block.In the Catch code, set the object’s ContinueUpdateOnError property to true.
C. Create an event handler for the SqlDataAdapter object’s RowUpdated event.In the event handler, if the SqlRowUpdatedEventArgs object’s UpdateStatus property has a value of UpdateStatus.ErrorsOccured, then set the SqlDataAdapter object’s ContinueUpdateOnErrorProperty to true.
D. Create an event handler for the SqlDataAdapter object’s RowUpdated event.In the event handler, if the SqlRowUpdatedEventArgs object’s Errors property returns a nonnull value, then set the SqlDataAdapter object’s ContinueUpdateOnError property to true.
Answer: A

You are creating an ASP.NET application that uses the Microsoft SQL Server .NET Data Provider to connect to BMW’s database. Your database administrator reports that, due to heavy usage of the application, data requests are being blocked while users wait for new connections to be created.You want to improve throughput by setting a minimum connection pool size of 10.What should you do?
A. Add a connection element under an appSettings element in the Web.config file for your application, and specify a minimum size of 10 for the connection pool.
B. Add a connection element under an appSettings element in the Machine.config file on your Web server, and specify a minimum size of 10 for the connection pool.
C. Add a Min Pool Size property to the connection string you use when opening a connection,and specify a minimum size of 10 for the connection pool.
D. Add a Min Pool Size property to your ADO.NET connection objects, and assign a value of 10to the property.
Answer: C

You are creating an ASP.NET application for BMW. An earlier version of the application uses ActiveX components that are written in Visual Basic 6.0. The new ASP.NET application will continue to use the ActiveX components.You want the marshaling of data between your ASP.NET application and the ActiveX
components to occur as quickly as possible.Which two actions should you take? (Each correct answer presents part of the solution. Choose
two)
A. Use ODBC binding.
B. Use late binding.
C. Use early binding
D. Set the AspCompat attribute of the Page directive to true.
E. Set the AspCompat attribute of the Page directive to false.
Answer: C, D

You are creating an ASP.NET application for BMW. The company data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a way that achieves this goal.What should you do?
A. Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored procedure that returns the data.
B. Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.
C. Configure SQL Server to support HTTP access, and create an XML template to run a stored procedure that returns the data in XML format.
D. Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object to run a SQL statement that returns the data.
Answer: B

You create English, French, and German versions of a test engine ASP.NET application you are developing for BMW Inc. You have separate resource files for each language version.You need to deploy the appropriate resource file based on the language settings of the server.What should you do?
A. Create an installer and set the Installer.Context property for each version of your application.
B. Create an installer that has a launch condition to verify the locale settings.
C. Create an installer that has a custom action to install only location-specific files.
D. Create an installer that has an MsiConfigureProduct function to install the appropriate
version.
Answer: C

You are creating an ASP.NET page to retrieve sales data from a Microsoft SQL Server database. You are writing a method named GetTestKSales to run a stored procedure in the SQL Server database. The stored procedure has one input parameter that is used to specify a product. The stored procedure returns to the year-to-date sales for that products.You declare a numeric variable in the GetTestKSales method. You want to assign the return value of the stored procedure to the variable.What should you do?
A. Create a SqlDataAdapter object and call its Fill method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
B. Create a SqlDataAdapter object and call its Update method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
C. Create a SqlCommand object and call its ExecuteScalar method to run the stored procedure and assigns the year-to-date sales value to your numeric variable.
D. Create a SqlCommand object and call its ExecuteReader method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
Answer: C

You are creating an ASP.NET application for BMW. Your code uses the System.Data namespace. The marketing managers at your company use a page on your Web site to edit the prices of the company’s products. You retrieve product part numbers, named, and prices from a database. You store this information in a DataSet object named productInfo, and you display the data on the Web page.The marketing managers use your page to edit one or more prices, and you record these
change in productInfo. The marketing managers click a Save button to save their changes.You write code in the Click event handler for the Save button to save the edited prices to the database. You want to extract the edited rows in productInfo before performing the update.You create a second DataSet object named productChanges to hold only edited product data.Which line of code should you use to copy the edited rows from productInfo into
productChanges?
A. productChanges = productInfo.GetChanges(DataRowState.Detached);
B. productChanges = productInfo.GetChanges();
C. productChanges.Merge(productInfo, true);
D. productChanges.Merge(productInfo, false);
Answer: B

You are creating an ASP.NET application for an online payment service. The service allows users to pay their bills electronically by using a credit card.
The application includes a payment page named Payment.aspx. This page contains a form for entering payee, payment amount, and credit card information. When a user needs to submit a new billing address to a payee, the page form allows the user to provide the new address information.If the user indicates a change of address, the application needs to provide the information to the ProcessAddressChange.aspx page for processing as soon as the user submits the payment
page information. The ProcessAddressChange.aspx page processes the request for a change of address but does not provide any display information for the user.
When the requested processing is complete. Payment.aspx displays status results to the user.You need to add a line of code to Payment.aspx to perform the functionality in ProcessAddressChange.aspx. Which line of code should you use?
A. Response.Redirect(“ProcessAddressChange.aspx”);
B. Response.WriteFile(“ProcessAddressChange.aspx”);
C. Server.Transfer(“ProcessAddressChange.aspx”,True);
D. Server.Execute(“ProcessAddressChange.aspx”);
Answer: D

You are planning the deployment of an ASP.NET application named TestKApp. TestKApp uses a Visual Studio .NET component named DataAccess that will be shared with other applications on your Web server.You are using Visual Studio .NET to create a Windows Installer package. You need to deploy DataAccess and the ASP.NET application so that they can be uninstalled later if necessary.What should you do?
A. Create a setup project for DataAccess.Add the ASP.NET application in a custom action.
B. Create a setup project for the ASP.NET application.Create another setup project for DataAccess.
C. Create a Web setup project for the ASP.NET application.Add a project output for DataAccess.
D. Create a Web setup project for the ASP.NET application.Add a merge module for DataAccess.
Answer: D

You are creating an ASP.NET page that displays a list of products. The product information is stored in a Microsoft SQL Server database. You use SqlConnection object to connect to the database.Your SQL Server computer is named BMW1. The database that contains the product information is named SalesDB. The table that contains the product information is named Products. To connect to SalesDB, you use a SQL Server user account named WebApp that has
the password TestKi12.You need to set the ConnectionString property of the SqlConnection object.Which string should you use?
A. “Provider=SQLOLEDB.1;File Name =”Data\MyFile.udl
B. “Provider=MSDASQL;Data Source=BMW1;Initial Catalog=SalesDB;User ID=WebApp;Password=TestKi12”
C. “Data Source=BMW1;Initial Catalog=SalesDB;User ID=WebApp;Password=TestKi12”
D. “Data Source=BMW1;Database=SalesDB;Initial File Name=Products;User ID=WebApp;Pwd=TestKi12”
Answer: C

You are creating and ASP.NET application for the mortgage services department of BMW Inc. The application will be used for generating documents required during the closing process of a home purchase.BMW already has a component written in Visual C# .NET that identifies which forms are required to be printed based on a set of criteria specified by the closing agent. The name of the component namespace is BMW.Mortgage. The name of the class is Closing.You create an ASP.NET page named Purchase.aspx. You add a reference to the assembly that contains the BMW.Mortgage namespace. The code behind file for Purchase.aspx includes the following code:using BMW.Mortgage; You add a method to the code-behind file to instantiate the Closing class.Which code segment should you include in the method to instantiate the class?
A. Closing TKClosing = new Closing();
B. Closing TKClosing =Server.CreateObject(“BMW.Mortgage.Closing”);
C. object TKClosing =Server.CreateObject(“closing”);
D. Type TKType =Type.GetTypeFromProgID(“BMW.Mortgage.Closing”,“localhost”, true);
Answer: A

You are debugging an ASP.NET application that was written by other developers at BMW.The developers used Visual Studio .NET to create the application. A TextBox control on one of the .aspx pages incorrectly identifies valid data values as being invalid.You discover that the validation logic for the TextBox control is located within a method that is defined in client-side code. The client-side code is written in Visual Basic Scripting Edition.You want to verify that the validation method is receiving valid input parameters when the page is running. You need to perform this task by stepping through the client-side code as it runs.Which four courses of action should you take? (Each correct answer presents part of the solution. Choose four)
A. In Internet Explorer, clear the Disable script debugging check box in the advanced options and browse to the page that contains the client-side code.
B. In Visual Studio .NET, select Debug Processes from the Tools menu and attach to the local copy of IExplore.exe.In the Running Document window, select the .aspx page that you want to debug.
C. Create a new active solution configuration named Client and copy the settings from the Release configuration.Select the new configuration in the Configuration Manager.
D. Set the following attribute in the application’s Web.config file:debug=”true”
E. In Solution Explorer, open the source for the .aspx file that you want to debug and select Start from the Debug menu.
F. In Visual Studio .NET, set a breakpoint or add a Stop statement in the client-side code where you want to begin interactive debugging.
G. In Internet Explorer, perform the actions that cause the client-side code to run.
Answer: A, B, F, G

You are using ASP.NET and ADO.NET to create an accounting application for BMW. You are writing code to run a set of stored procedures that perform posting operations in a database at the end of each month.You use an OleDbConnection object to connect to the database. You use an OleDbCommand object to run the stored procedures.If an error occurs during execution of any of the stored procedures, you want to roll back any data changes that were posted. You want the changes to be committed only of all of the posting operations succeed.You write code to catch an OleDbException object if an error occurs during the execution of a stored procedure.What else should you do?
A. Call the BeginTransaction method of the OleDbConnection object before running the stored procedure.If an error occurs, use the OleDbConnection object to roll back the changes.
B. Call the BeginTransaction method of the OleDbConnection object before running the stored procedures.If an error occurs, use the OleDbException object to roll back the changes.
C. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Assign the OleDbTransaction object to the Transaction property of your OleDbCommand object.If an error occurs, use the OleDbTransaction object to roll back the changes.
D. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Pass a reference to the OleDbTransaction object to each stored procedure.Use error handling inside the stored procedures to roll back the changes.
Answer: C

You create a reporting application for BMW’s Travel. You create several reports, each of which resides in its own folder under the Report folder. Each subfolder has the appropriate security rights sets for Microsoft Windows users.You write a function named ListReports that generate a list of available reports. You want to configure the application and the ListReports function to find out which reports are available to the current user.If a user is logged in by using Windows authentication, you want ListReports to apply that user’s rights. If the user is not logged in by using Windows authentication, you want
ListReports to use the rights granted to the BMWtravel\ReportingAccount user account. The password for this user accounts is “p1testki32” Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Add the following element to the Web.config file:<identity impersonate=”false”>
B. Add the following element to the Web.config file.<identify impersonate=”true”>
C. Add the following element to the Web.config file:<identity impersonate=”true” userName=”margiestravel\ReportingAccount” password=” p1testki32”>
D. Add the following element to the Web.config file:<authorization><allow user=”BMWtravel\ReportingAccount”></authorization>
E. Add code to the ListReports function to create and use a WindowsPrincipal object based on the BMWtravel\ReportingAccount user account only if no user is authenticated.
F. Add code to the ListReports function to always create and use a WindowsPrincipal object based on the BMWstravel\ReportingAccount user account.
Answer: B, E

You plan to deploy your ASP.NET application over BMW’s intranet. The application uses data retrieved from a Microsoft SQL Server database. You want to use SQL Server connection pooling to optimize performance. You also need to protect confidential data stored on the server while minimizing administrative costs.
You need to configure security for your application. What should you do?
A. Use Microsoft Windows authentication in the application.Enable impersonation for users to access the SQL Server database from your application.
B. Use Microsoft Windows authentication in the application.Use a single Windows account for users to access the SQL Server database from your
application.
C. Use form-based authentication in the application.Use the system administrator (sa) SQL Server login for users to access the SQL Server database from your application.
D. Use form-based authentication in the application.Assign each user a separate SQL Server login to use to access the SQL Server database from
your application.
Answer: B

You are creating an order entry application named TestKiEntry. You set Orders.aspx as the start page. You want users to log on to Orders.aspx by supplying a user name and password.You create a Login.aspx page to validate the user name and password.You need to ensure that users log on by using Login.aspx before they are allowed to access Orders.aspx. Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. In the authentication section of the Web.config file, set the mode attribute of the authentication element to Forms.Set the name attribute of the forms element to Login.aspx.
B. In the authentication section of the Web.config file, set the mode attribute of the authentication element to Forms.Set the loginUrl attribute of the forms element to Login.aspx.
C. In the authorization section of the Web.config file, set the users attribute of the deny element to “?”:
D. In the credentials section of the Web.config file, set the users attribute of the deny element to “?”.
E. In the credentials section of the Machine.config file, set the users attribute of the deny element to “*”.
F. In the authorization section of the Machine.config file, set the mode attribute of the authentication element to Forms.Set the policyFile attribute of the trust element to Login.aspx.
G. Create a Page directive in Orders.aspx to load the Login.aspx page.
Answer: B, C

You create an ASP.NET application. The application uses integrated security to retrieve information from a Microsoft SQL Server database named BMWSalesOrder. You need to provide a connection string for the application to use to connect to BMWSalesOrder. You decide to store the connection string in the Web.config file.How should you set up the Web.config file?
A. In the configuration section, create an element named appSettings.Create and add element that has a key attribute set to SQLConnection, and a value attribute set to the connection string.
B. In the configuration section, create an element named SQLConnection.Create a key element that has a value attribute set to the connection string.
C. In the authorization section, create an element named SQLConnection.Create a key element that has a value attribute set to the connection string.
D. In the authentication section, create an element named appSettings.Create an element named SQLConnection that has a value attribute set to the connection
string.
Answer: A

You are configuring your ASP.NET application BMWApp. BMWApp will be hosted on a Web server that also runs other applications.You want to prevent any changes to the configuration settings of your application after the application is deployed.What should you do?
A. In the Machine.config file, set the allowOverride attribute in the location element to False.Make no other changes to the Machine.config file.
B. In the Web.config file, set the allowOverride attribute in the location element to False.Make no other changes to the Web.config file.
C. In the Machine.config file, set the allowOverride attribute in the appSettings element to False.Make no other changes to the Machine.config file.
D. In the Web.config file, set the allowOverride attribute in the appSettings element to False.Make not other changes to the Web.config file.
Answer: B

You are configuring security for your ASP.NET application. The folders for your pages are located in a hierarchy as shown in the exhibit.You need to allow all uses to access pages located in the Products folder and the Orders folder.You need to allow any members of the Accounting role to access pages located in the Accounting folder.What are two possible waves achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Add code to the Global.asax file to dynamically configure access to the Accounting folder.
B. Place the authorization settings for all roles in the Web.config file located in the Products folder.Use the location tag in the Web.config file to deny access to the Accounting folder for all roles except the Accounting role.
C. Place the authorization settings for all roles in the Web.config file located in the Products folder.
Allow access for only members of the Accounting role in the Web.config file located in the Accounting folder.
D. Create two custom roles in the Machine.config file for the application.Configure one role for all users, and one role for the Accounting users.
Deny access to the Accounting folder for all users except members of the Accounting role.
Answer: B, C

You create an ASP.NET application that will be sold to BMW’s corporate customers. The corporate customers will buy your application and run it on their intranets.You create a Web setup project for your application and add it to your ASP.NET solution. You also add a file named Readme.txt to the Web setup project.You create the deployment package and install it on a test server. You notice that the deployment package installed Readme.txt in the Web application folder. You want the deployment package to add a shortcut to Readme.txt to the desktop on the server computer.What should you do?
A. Add Readme.txt to your solution and rebuild the deployment package.
B. Select Readme.txt in the Web setup project.
Change the TargetName property to DESKTOP\Readme.txt.
C. In the Web setup project, add the User’s Desktop folder to the File System on Target Machine node.Add a shortcut to Readme.txt in the User’s Desktop folder.
D. In the Web setup project, add a custom folder to the File System on Target Machine node.Name the folder Server Desktop and add a shortcut to Readme.txt in that folder.
Answer: C

As a software developer at BMW you create an ASP.NET application for online ordering.You need to store a small amount of page-specific information on pages that are submitted to the server. This information does not need to be secured. The page must work properly for browsers that do not support cookies. You anticipate that the volume of orders on the site will be high, and you need to conserve server resources.What should you do?
A. Store the information in application state variables.
B. Store the information in session state variables.
C. Store the information in a Microsoft SQL Server database.
D. Store the information in hidden fields on the page.
Answer: D

You create an assembly to access data in a relational database named BMWData. This assembly will be used by several ASP.NET applications on your Web server.
You need to ensure that all your applications can access the assembly. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Run the Assembly Registration tool (Regasm.exe).
B. Run the String Name tool (Sn.exe).
C. Run the Installer tool (Installutil.exe).
D. Run the Global Assembly Cache tool (Gacutil.exe).
Answer: B, D

You create an ASP.NET application that is deployed on BMW’s intranet. Sales representatives use this application to connect to a database while they are speaking to customers on the telephone. Your code is running under the security context of the user who requested the page.The application requires each sales representative to supply a unique user name and password to access the application. These individual user names and passwords are included in the
ConnectionString property settings that your code uses to connect to the database. All users have the same access rights to the database.Sales representatives report that it takes a long time to access the database. You test the application and discover that a new connection is created each time a sales representative connects to the database.You want to reuse connections in order to reduce the time it takes to access the database.What should you do?
A. Modify the connection string to specify Windows Integrated authentication.
B. Modify the connection string to increase the connection timeout setting.
C. Modify the connection string so that is uses a single application user name and password for every connection to the database.
D. Modify the connection string so that is uses a login user named that is a member of the sysadmin fixed server role.
Answer: C

You are creating an ASP.NET page for a travel service. The page contains a CheckBoxList control that contains travel destinations. Customer can select favorite destinations to receive weekly e-mail updates of travel packages.The CheckBoxList control is bound to a database table of possible destinations. Each destination is ranked according to its popularity. You modify the page to sort the destination list by rank, from the most popular to the least popular. The list has three columns.You want the most popular destination to be on the top row of the check box list at run time.Which property setting should you use for the CheckBoxList control?
A. Set the RepeatDirection property to Vertical.
B. Set the RepeatDirection property to Horizontal.
C. Set the RepeatLayout property to Flow.
D. Set the RepeatLayout property to Table.
Answer: B

You are creating an ASP.NET page for BMW’s Web site. Customers will use the ASP.NET page to enter payment information.You add a DropDownList control named cardTypeList that enables customers to select a type of credit card. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the cardTypeList control.You want the page validation to fail if a customer does not select a credit card type from the
list.What should you do?
A. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList.Set the InitialValue property of the RequiredFieldValidator control to Select.
B. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList.Set the DataTextField property of the cardTypeList control to Select.
C. Add a CustomValidator control and set its ControlToValidate property to cardTypeList.Set the DataTextField property of the cardTypeList control to Select.
D. Add a RegularExpressionValidator control and set its ControlToValidate property to cardTypeList.Set the ValidateExpression property of the RegularExpressionValidator control to !Select.
Answer: A

You are a Web developer for BMW Publishing. You are performing a migration of your company’s ASP-based Web page named Booklist.asp to ASP.NET. You want to deploy the ASP.NET version of your Web page with the minimum amount of development effort. You also want the migration to be accomplished as quickly as possible. The page contains a COM component named BMW.BookList. The component is written in Microsoft Visual Basic 6.0. When you open the new page, you receive the following error message: “Server error – The component ‘BMW.BookList’ cannot be created.”  You need to ensure that you can open the Web page successfully.What should you do?
A. Write a manage component to perform the tasks that the Lucerne.BookList component currently performs.
B. Set the AspCompat attribute of the Page directive to true.
C. Add the following line of code to the Page.Load event handler:RegisterRequiresPostBack(“BMW.BookList”;
D. Add the following attribute to the processModel element of the Web.config file:comImpersonationLevel = Delegate
Answer: B.

Your ASP.NET application BMWApp displays sales data on a page. You want to improve performance by holding the page in memory on the server for one hour. You want to ensure that the page is flushed from memory after one hour, and that the page is re-created when the next request for the page is received.What should you do?
A. Initialize a new instance of the Cache class in the Application.Start event handler.
B. Initialize a new instance of the Timer class in the Page.Load event handler.
C. Set the Duration attribute of the OutputCache directive in the page.
D. In the Web.config file, set the timeout attribute of the sessionState element.
Answer: C

You create an ASP.NET application that contains confidential information. You use formbased authentication to validate users. You need to prevent unauthenticated users from accessing the application.What should you do?
A. Set a Page directive in the start page of your application to redirect users to a login page.
B. Set a Page directive in the start page of your application to disallow anonymous users.
C. In the authorization section of the Machine.config file, set the users attribute to the allow element to “?”.
D. In the authorization section of the Web.config file, set the users attribute of the deny element to “?”.
Answer: D

You are creating an ASP.NET application for BMW. Users will use the application to produce reports. The data for the application is stored in a Microsoft SQL Server 2000 database named BMWSrv.You expect many users to use the application simultaneously. You want to optimize the response time when the users are retrieving data for the reports.You create a procedure to retrieve the data from the database. You store a valid connection string in a variable named connString in the procedure.You need to add code to the procedure to connect to the database.Which code segment should you use?
A. OleDb.OleDbConnection cnn = new OleDb.OleDbConnection(connString);
B. SqlClient.SqlConnection cnn = new SqlClient.SqlConnection(connString);
C. ADODB.Connection cnn = new ADODB.Connection();
D. SQLDMO.Database cnn = new SQLDMO.Database();
Answer: B

You create an ASP.NET application for an insurance company BMW Insurance. The application is used to generate automobile insurance quotes. One page in the application allows the user to enter a vehicle identification number (VIN). The page provides manufacturing information on the identified vehicle, and that information is used in rating the vehicle for insurance.The only control on the page is a TextBox control for entering the VIN. You define an event handler for the change event of the TextBox control. The event handler performs the vehicle lookup in the database. The AutoPostBack attribute of the TextBox control is set to True.During testing, you attempt to browse to the page by using Internet Explorer on one of your test computers. You discover you do not receive vehicle information after entering a valid VIN and using the TAB key to move out of the text box. This problem does not occur when you use other test computers that are running Internet Explorer.What should you do?
A. Configure Internet Explorer to allow scripting.
B. Configure Internet Explorer to allow page transitions.
C. In the Page directive, set the SmartNavigation attribute to “True”.
D. In the Page directive, set the AutoEventWireup attribute to “True”.
Answer: A

You are creating an ASP.NET page that enables users to select a country and view information on tourist attractions in that country. Users select a country from a list box named countryList.The list box displays country names. The list box also contains hidden country codes.Your code retrieves a cached DataTable object that contains tourist attraction descriptions and a numeric country code named CountryID. The DataTable object is named attractionsTable.You want to extract an array of DataRow objects from the DataTable object. You want to include tourist attractions for only the selected country.Which code segment should you use?
A. DataRow[] result = attractionsTable.Select(“CountryID = “ + countryList.SelectedItem.Text);
B. DataRow[] result = attractionsTable.Select(“CountryID = “ + countryList.SelectedItem.Value);
C. DataRow result =attractionsTable.Rows.Find(“CountryID = “ + countryList.SelectedItem.Value);
D. DataRow result =attractionsTable.Rows.Find(countryList.SelectedItem.Value);
Answer: B

You are creating an ASP.NET application for an insurance company BMW Insurance. The company will use your ASP.NET application to record insurance claims.
Another development team creates a redistributable component that will be used by your ASP.NET application. The component requires several registry entries to be created during installation so that the component will run properly. The same component might be used by other ASP.NET applications in the future.
The development team gives you the source code to the component as well as all of the project files for the component. You add the component project to your ASP.NET application.You need to create a deployment package for your application. You want to include the redistributable component with your deployment package.What should you do?
A. Create a setup project for the redistributable component.Create a Web setup project for your ASP.NET application.
B. Create a merge module project for your ASP.NET application.Create a setup project for redistributable component and add the merge module for your ASP.NET application to the project.
C. Create a merge module project for both your ASP.NET application and the redistributable component.
Create a Web setup project and add both merge modules to the project.
D. Create a merge module project for the redistributable component.Create a Web setup project for your ASP.NET application and add the merge module for the redistributable component to the project.
Answer: D

You are creating an ASP.NET application. The application will be deployed on BMW’s intranet. BMW uses Microsoft Windows authentication.You want the application to run in the security context of the user.What should you do?
A. Add the following element to the authentication section of the Web.config file:<allow users=”?”/>
B. Add the following element to the system.web section of the Web.config file:<identity impersonate=”true”/>
C. Use the Configuration Manager for your project to designate the user’s security context.
D. Write code in the Application_AuthenticateRequest event handler to configure the application to run in the user’s security context.
Answer: B

You write code to perform a standard financial calculations that are required by BMW.The code accepts input parameters such as interest rate and investment amount. It then calculates values based on different predetermined scenarios.You want to create a control that encapsulates this functionality. You want to be able to easily use this control by dragging it from the toolbox onto your Web forms. You also plan to include full support for visual design tools.
You want to create a project to test the control.Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. Create a Web user control.
B. Create a Web custom control.
C. Create a new Web Form project.Use the COM Components tab of the Customize Toolbox dialog box to specify the new control.
D. Create a new Web Form project.Use the .NET Framework Components tab of the Customize Toolbox dialog box tospecify the new control.
E. Create a new Web Form project.Select Add Reference from the Project menu and browse to the new control.
Answer: B, D

You are creating an ASP.NET application that will be published in several languages. You develop a satellite assembly that will include the localized resources for one of the other languages. The satellite assembly will also contain code that accesses Enterprise Services.BMW has a build team that is responsible for compiling and publishing all software applications created by your group. The build team is also responsible for digitally signing the
software with a public/private key pair.The build team permits you to have access to BMW’s public key, but not the private key. In order to test your localized satellite assembly, you need to digitally sign the assembly.What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Create a test certificate for your satellite assembly by using the Software Publisher Certificate Test tool (Cert2spc.exe).
B. Compile the satellite assembly by using the Resource File Generator (Resgen.exe) with the /compile switch.
C. Compile the satellite assembly by using the Assembly Linker (Al.exe) with the /delay+switch.
D. Use the Global Assembly Cache tool (Gacutil.exe) to install the assembly in the global assembly cache.
E. Generate a new public/private key pair by using the Strong Name tool (Sn.exe).Use the new key pair to sign the assembly temporarily for testing purposes.
Answer: C, E

You are creating a Web Form for BMW’s human resources department. You create a Web user control named Employee that allows the user to edit employee information. Each instance of the control on your Web Form will contains information about a different employee.You place the Employee control on the Web Form and name the control TK1. You also add the Employee control to the ItemTemplate of a Repeater control named repeaterEmployees.Each Employee control in repeaterEmployees contains several TextBox controls. You want your Web Form to handle TextChanged events that are raised by these TextBox controls.
Which event handler should you use?
A. private void TK1_TextChanged(object source,EventArgs e)
B. private void repeaterEmployees_ItemDataBound(object source,RepeaterItemEventArgs e)
C. private void repeaterEmployees_DataBinding(object source,RepeaterItemEventArgs e)
D. private void repeaterEmployees_ItemCommand(object source,RepeaterCommandEventArgs e)
Answer: B

Your ASP.NET application enables customers to create new sales orders. The sales orders are stored in a Microsoft SQL Server database table named BMWSales. The table has an IDENTITY column named OrderID.Your code uses a DataTable object to manage the order data. The DataTable object contains a column named OrderNumber. You use the Update method of a SqlDataAdapter object to call a stored procedure that inserts each new order into the database. The stored procedure uses a parameter to return the new OrderID value for each order.You assign a SqlCommand object to the InsertCommand property of the SqlDataAdapter
object. You add a SqlParameter object to the Parameters collection of the SqlDataAdapter object, specifying the name and data type of the parameter.
You need to set properties of the SqlParameter object to retrieve new OrderID values from the database into the OrderNumber column of your DataTable object.
What should you do?
A. Set the Direction property to ParameterDirection.ReturnValue. Set the SourceColumn property to “OrderID”.
B. Set the Direction property to ParameterDirection.ReturnValue. Set the SourceColumn property to “OrderNumber”.
C. Set the Direction property to ParameterDirection.Output. Set the SourceColumn property to “OrderID”.
D. Set the Direction property to ParameterDirection.Output. Set the SourceColumn property to “OrderNumber”.
Answer: D

You are using your computer to debug and ASP.NET application. Your login account has administrative permissions for your computer. The application contains several existing ASP pages that use server-side scripts. These server-side scripts are written in Microsoft Visual Basic Scripting Edition.You locate a line of VBScript code in an existing ASP page that might be incorrect. You add a breakpoint on the line. When you run the application, everything appears to work properly,but the breakpoint is not invoked. When you examine the breakpoint in the VBScript code, you see the following ToolTip: “The breakpoint will not currently be hit. No symbols have been loaded for this document.”You want the breakpoint to be invoked when you run the application in Debug mode.What should you do?
A. Open the Configuration Manager and set the Active Solution Configuration option to Debug.
B. Select the ASP page in Solution Explorer.Set the Build Action property to Compile.
C. Open the property pages for the ASP.NET application and select the Enable ASP Debugging check box.
D. Select Options from the Tools menu.Select the Debugging folder.In the General category, select the Insert breakpoints in Active Server Pages for breakpoints in client script check box.
Answer: C

You company’s project team develops an order fulfillment ASP.NET application. The application is hosted on a single server named BMW1.You are responsible for verifying and correcting problems identified by the quality assurance team. The quality assurance team reports that freight costs are not being calculated accurately.You need to replicate the problem in order to resolve it.You attempt to use the interactive debugger from your client computer to step through the
ASP.NET application code on BMW1. You are not able to initiate a debugging session, and the following entry is added to the Application event log on your computer: “DCOM got error ‘General access denied error’ from the computer BMW1 when attempting to activate the server.” You need to enable remote debugging.
What should you do?
A. Add your user account to the Power Users group on your client computer.
B. Add your user account to the Power Users group on BMW1.
C. Add your user account to the Debugger Users group on your client computer.
D. Add your user account to the Debugger Users group on BMW1.
Answer: D

You are maintaining an ASP.NET application named BMWSalesForecast. The application is written in Visual C# .NET. The application includes a page named FirstQuarter.aspx that resides within the Sales namespace. The page class is named FirstQuarter.You discover that another developer inadvertently deleted the Page directive for FirstQuarter.aspx. You want to create a new Page directive to allow FirstQuarter.aspx to work properly.Which directive should you use?
A. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” Inherits=”FirstQuarter”%>
B. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” ClassName=”Sales.FirstQuarter”%>
C. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs”> Inherits=”Sales.FirstQuarter”%>
D. <%@ Page Language=”c#” Codebehind=”FirstQuarter.aspx.cs” ClassName=”Sales.FirstQuarter”Inherits=”FirstQuarter”%>
Answer: C

You create an ASP.NET application to display sales analysis information for BMW. A page named TkSalesSummary.aspx displays three separate sections of information.For each section, you write code that calls a stored procedure in a database. The code for each section calls a different stored procedure. After the stored procedure runs, the results are immediately written in HTML format to the Response object for the application.You do not want users to wait until the results are returned from all three stored procedures before they begin to receive content rendered in their browser. What are two possible ways to
achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Set the SuppressContent property of the Response object to False.
B. Set the BufferOutput property of the Response object to False.
C. Set the CacheControl property of the Response object to Public.
D. Insert the following statement after each section is written to the Response object for the application:Response.Clear();
E. Insert the following statement after each section is written to the Response object for the application:Response.ClearContent();
F. Insert the following statement after each section is written to the Response object for the application:Response.Flush();
Answer: B, F

You create an ASP.NET page named Location.aspx. Location.aspx contains a Web user control that displays a drop-down list box of counties. The Web user control is named CountyList and is defined in a file named CountyList.ascx. The name of the DropDownList control in CountyList.ascx is TKCounty.You try to add code to the Page.Load event handler for Location.aspx, but you discover that you cannot access TKCounty from mode in Location.aspx. You want to ensure that code within Location.aspx can access properties of TKCounty.What should you do?
A. In the code-behind file for CountyList.ascx add the following line of code: protected DropDownList TKCounty;
B. In the code-behind file for CountyList.ascx, add the following line of code: public DropDownList TKCounty;
C. In the code-behind file for Location.aspx, add the following line of code: protected DropDownList TKCounty;
D. In the code-behind file for Location.aspx, add the following line of code: public DropDownList TKCounty;
Answer: B

You use Visual Studio .NET on your client computer to develop an ASP.NET application on a remote server. The application provides asset management functionality.Another developer at BMW uses Visual C# .Net to develop a custom component named AssetManagement. Your ASP.NET application uses this custom component. The AssetManagement component defines an Asset class that exposed a public method named DepreciateAssets(). You deploy AssetManagement to the remote server that hosts your ASP.NET application. You also add the source files of AssetManagement to your ASP.NET application.You are debugging an .aspx page in your application by using the Visual Studio .NET interactive debugger. The code in the page creates an instance of the Assets class and then calls
the DepreciateAssets() method of that instance.You attempt to step into a call to the DepreciateAssets() method. Instead of showing the first line of code in the DepreciateAssets() method, the interactive debugger moves to the next line of code in the .aspx page.You need to enable the interactive debugger to step into the code within the Assets class.What should you do in Visual Studio .NET?
A. Configure Visual Studio .NET to enable just-in-time debugging for native programs.
B. Configure Visual Studio .NET to allow editing of Visual C# files while debugging.
C. In the Configuration Manager, select the Debug configuration and rebuild the AssetManagement component.
D. In the Configuration Manager, select the Debug configuration and rebuild the ASP.NET application.
Answer: C

You create an ASP.NET application named Inventory. This application will be used by customers on the Internet.During the beta test period, you ensure that the actual ASP.NET error message is displayed whenever an error is encountered. Both developers and beta testers see the actual text of the error message.
You perform beta testing of other applications on the same beta test server during the beta testing period for Inventory. All of the other applications display ASP.NET error messages.After the beta testing period is complete, the beta test server is promoted to a production server. You want all applications to display a single, user-friendly error message.You want to configure Inventory and the production server to meet these goals. You want to perform this task by using the minimum amount of administrative effort.Which two actions should you take? (Each correct answer presents part of the solution. Choose
two)
A. Set the mode parameter of the customErrors element in the Web.config file for Inventory to “On”.
B. Remove the customErrors element from the Web.config file for Inventory.
C. Set the mode parameter of the customErrors element in the Inventory.config file to “On”.
D. Remove the customErrors element from the Inventory.config file.
E. Set the mode parameter of the customErrors element in the Machine.config file to “On”.
F. Remove the customErrors element from the Machine.config file.
Answer: B, E

You create an ASP.NET application for BMW’s purchasing department. A page in the application displays a list of products based on the supplier, the product category, or the price.The URL of the page includes this information as parameters.You want to store multiple versions of your ASP.NET page in the cache based in the parameter values. You want each version of the page to be cached for 300 seconds.You need to add code to the page to accomplish this goal.
Which code segment should you use?
A. Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));Response.Cache.VaryByParams[“?”] = true;
B. Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));Response.Cache.VaryByParams[“All”] = true;
C. Response.Cache.SetCacheability(HttpCacheability.Public);Response.Cache.
SetLastModified(DateTime.Parse(“00:05:00”));Response.Cache.VaryByParams[“All”] = true;
D. Response.Cache.SetCacheability(HttpCacheability.Public);Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));
Response.Cache.VaryByParams[“*”] = true;Answer: D

You create an ASP.NET application for BMW’s intranet. All employee on the intranet use Internet Explorer.A page named UserAccount.aspx contains several controls that require postback to the server for event processing. The event handlers for these controls require access to a database in order to complete their processing.Each time UserAccount.aspx performs a postback, there is a brief period of time in which the browser window is blank while the page is refreshed. The control that had the focus prior to the postback does not have the focus after the page is re-rendered. This factor results in confusion and invalid data entry by some of the users. You need to modify UserAccount.aspx to prevent the browser window from going blank after a postback and to maintain the correct control focus after events are processed. You need to accomplish this task with the minimum amount of development effort.What should you do?
A. Add the following attribute to the HTML code for the controls that cause the postbacks:RunAt=”client”
B. Add the following attribute to the HTML code for the controls that cause the postbacks:EnableViewState=”True”
C. Add the following attribute to the Page directive for UserAccount.aspx:SmartNavigation=”True”
D. Add the following attribute to the OutputCache directive for UserAccount.aspx:Location=”client”
Answer: C

You are creating a shopping cart application for BMW. The application loads the category and product data only once in each user’s session.You create two DataTable objects. One DataTable object is named Categories, and the other DataTable object is named Products. The Categories object remains static, but the Products object is modified when the user selects products and enters quantities to purchase.You want to minimize the time it takes the page to reload after each change.Which pair of statements should you use?
A. Cache[“Categories”] = Categories;Session[“Products”] = Products;
B. Session[“Categories”] = Categories;Cache[“Products”] = Products;
C. Session[“Categories”] = Categories;Session[“Products”] = Products;
D. Cache[“Categories”] = Categories;Cache[“Products”] = Products;
Answer: A.

You create an ASP.NET application for an online insurance site BMW Insurance. A page named VehicleInformation.aspx has the following Page directive:<%@ Page Language=”c#” CodeBehind=”VehicleInformation.aspx.cs” AutoEventWireup=”false” inherits=”InsApp.VehicleInfo”%>
VehicleInformation.aspx had a TextBox control named vehicleIDNumber in which the user can enter a vehicle identification number (VIN). The HTML code for this control is as follows: <asp:TextBox ID=”vehicleIDNumber” Columns=”20” Runat=”server”/> You need to implement a TextChanged event handler for vehicleIDNumber. You want this event handler to retrieve information about a vehicle by using an XML Web service that charges for each access. The page will then be redisplayed with additional information about the vehicle obtained from the XML Web service.
You are implementing the TextChanged event handler.Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two)
A. In the Page directive for VehicleInformation.aspx, ensure that the AutoEventWireup attributes is set to “true”.
B. In the Page directive for VehicleInformation.aspx, ensure that the EnableViewState attribute is set to “true”.
C. In the vehicleIDNumber HTML element, ensure that the AutoPostback attribute is set to “false”.Include code for the client-side onserverchange event to submit the Web Form for processing by the server.
D. In the vehicleIDNumber HTML element, ensure that the AutoPostback attribute is set to “true”.Include code in the TextChanged event handler to query the XML Web service.
Answer: B, D

You are creating an ASP.NET application for BMW. The company deploys an XML Web service that returns a list of encyclopedia articles that contain requested keywords.You want to create a class that calls the XML Web service.What should you do?
A. Select Add Web Service from the Project menu in Visual Studio .NET and browse to the XML Web service.
B. Select Add Reference from the Project menu in Visual Studio .NET and browse to the XML Web service.
C. Select Add Web Reference from the Project menu in Visual Studio .NET and browse to the XML Web service.
D. Run the Type Library Importer (Tlbimp.exe) and provide it with the URL for the XML Web service.
E. Run the Web Services Discover tool (Disco.exe) and provide it with the URL for the XML Web service.
Answer: C

You create an ASP.NET application named TKApp. You create an assembly named TKApp.dll in a directory named TKDir. The assembly includes a default resource file named strings.resources that adequately support English-speaking users of the application. You create an additional resource file named strings.ja.resources to enable support for Japanese-speaking users. The resource file is located in the TKDir/ja subdirectory. You want to create a satellite
assembly for TKApp.dll that will use the new resource file.What should you do?
A. Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.Place the output assembly in TKDir.
B. Run the Assembly Linker (Al.exe) to embed strings.ja.resources in the output assembly.Place the output assembly in TKDir/ja.
C. Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.Place the output assembly in TKDir.
D. Run the Assembly Linker (Al.exe) to link strings.ja.resources to the output assembly.Place the output assembly in TKDir/ja.
Answer: B

As a software developer at BMW you are creating an ASP.NET application that will display facts about the solar system. This application will support localization for users from France,Germany, Japan, and the United States. To see information about a particular planet, the user will select the planet from a drop-down list box on SolarSystem.aspx.You want to display the planet names in the drop-down list box in the language appropriate to the individual who is using the application.What should you do?
A. Create a database table named Planets.Create three column named PlanetID, LocaleID, and Description.Use SqlCommand.ExecuteReader to query the table for the locale specified in the request.Using the locale specified in the request, translate the values by using the TextInfo.OEMCodePage property.Populate the drop-down list box with the translated text.
B. Create a DataTable object named Planets.Populate the Planets DataTable object by using string constants.Using the locale specified in the request, translate the values by using a UnicodeEncoding object.Bind the DataSource property of the drop-down list box to the DataTable object.
C. Create a database table named Planets.Create two columns named PlanetID and Description.Use a SqlDataAdapter to load the planet information into a DataSet object.Using the locale specified in the request, use the String format provider to translate the values.Bind the DataSource property of the drop-down list box to the DataSet.DefaultView object.
D. Create string resources assemblies for each locale.Using the locale specified in the request, use a ResourceManager to load the appropriate assembly.Populate an array with the string values from the assembly.Bind the DataSource property of the drop-down list box to the array.
Answer: D

You are creating an ASP.NET page for BMW. The page contains a DataGrid control that displays all the current prices for the commodities that BMW purchases. The page also contains a Button control that refreshes the data in the DataGrid control.The DataGrid control needs to be repopulated each time the page is displayed. The data is accessed through a DataView object stored in the Session object. You want to ensure the fastest load time for the page.What should you do?
A. Set the DataSource property and call the DataBind method of the DataGrid control in the Click event handler for the Button control.
B. Set the DataSource property and call the DataBind method of the DataGrid control in the Start event handler for the Session object.
C. Set the EnableViewState property of the DataGrid control to false.
D. Set the EnableViewState property of the DataGrid control to true.
Answer: C

You create an ASP.NET application named TestKApp for BMW’s intranet. TestKApp stores static data in a flat file. The file is located in a separate directory on the Web server. You want to allow only your application to access this directory.TestKApp uses Microsoft Windows authentication. The application runs successfully on your computer. However, when TestKApp is deployed to the test server, testers report a permission error when the application attempts to access the flat file.You need to ensure that the application can load the data from the flat file. You want to prevent users from using the file system to read the file.What should you do?
A. Add the following element to the authorization section of the Web.config file: <identity impersonate=”true”/>
B. Add the following element to the system.web section of the Web.config file: <allow users=”system”/>
C. Grant the ASPNET account Read permission on the directory where the file is located.
D. In the Machine.config file, set the userName attribute in the processModel section to “system”.
Answer: C

You develop a contact management application that will enable users to retrieve information from a central database. After the data is returned to your application, users must be able to view it, edit it, add new records, and delete existing records. All user changes must then be saved in the database.
Your application design requires several ADO.NET object to work together to accomplish these requirements. You use classes from the System.Data and System.Data.OleDb namespaces.First you write the code to connect to the database.Which four actions should you take next? (Each correct answer presents part of the solution.Choose four)
A. Create an OleDbDataAdapter object and define the SelectCommand property.
B. Create an OleDbCommand object and use the ExecuteScalar method.
C. Create a DataTable object as container for the data.
D. Create a DataSet object as a container for the data.
E. Call the DataAdapter.Fill method to populate the DataSet object.
F. Call the DataAdapter.Update method to populate the DataSet object.
G. Call the DataAdapter.Update method to save changes to the database.
H. Call the DataSet.AcceptChanges method to save changes to the database.
Answer: A, D, E, G

You create an ASP.NET application named TimeSheet for BMW’s intranet. The application will be used only by employees of your company.You want the application to recognize the user without forcing the user to enter a name and password. You write the following code to save the user’s Microsoft Windows login name in
the Session object: Session.Item(“User”)=User.Identity.Name; When you run the TimeSheet, the Session.Item(“User”) variable returns an empty string.You want to configure Internet Information Services (IIS) and your application to be able to retrieve the user name automatically.What should you do?
A. Disable Anonymous Access for the application in IISB.Enable Basic authentication for the application in IIS
C. Add the following element to the Web.config file for TimeSheet:<identity impersonate=”True” />
D. Add the following element to the Web.config file for TimeSheet:<identity impersonate=”False” />
Answer: A

You create an ASP.NET application for a hotel. The application contains a page that displays current weather conditions for the city in which the hotel is located. The application calls an XML Web service every 10 minutes to update the current weather conditions. A new page is then displayed for subsequent requests.You want the same page to be cached and retrieved from the cache during the time between calls to the XML Web service. You decide to use a Page directive to accomplish this goal.Which page directive should you use?
A. <%@ Cache Seconds=”600” VaryByParam=”page” %>
B. <%@ OutputCache Time=”600” %>
C. <%@ OutputCache Duration=”600” VaryByParam=”None” %>
D. <%@ OutputCache Duration=”600” %>
Answer: C

You deploy and ASP.NET application. When an error occurs, the user is redirected to a custom error page that is specified in the Web.config file.
Users report that one particular page is repeatedly generating errors. You need to gather detailed error information for the page. You need to ensure that users of the application continue to see the custom error page if they request pages that generate errors.What should you do?
A. In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly and access the page from a browser on your client computer.
B. In the Web.config file, set the mode attribute of the customErrors element to RemoteOnly and access the page from a browser on the server.
C. Modify the Page directive so that the Trace attribute is set to True and the LocalOnly attributes is set to true, and then access the page from a browser on the server.
D. Modify the Web.config file to include the following element: <trace enabled=”true” LocalOnly=”false” PageOutput=”true”/>Access the application from a browser on your client computer.
Answer: B

You create an ASP.NET application named TKProject on your client computer. The application has a page named ProjectCalendar.aspx. This page is located in a virtual directory named Scheduling, which is a child of the TKProject root directory. ProjectCalendar.aspx uses cookies to track modifications to the schedule during a user’s session so that the user can undo modifications if necessary.You deploy your application on a computer named BMWSrv. Users report that the undo functionality stops working after they execute a specific sequence of actions. You need to view the cookie values after the sequence of actions to help identify the cause of the problem.You add the following element to the Web.config file: <trace enabled=”true” pageOutput=”false”/> You want to display the trace output information on your client computer.Which URL should you use?
A. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx?Trace=true
B. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx?trace.axd
C. HTTP://BMWSrv/TKProject/Scheduling/ProjectCalendar.aspx
D. HTTP://BMWSrv/TKProject/ProjectCalendar.aspx?trace.axd
E. HTTP://BMWSrv/TKProject/ProjectCalendar.aspx?trace.axd
F. HTTP:// BMWSrv/TKProject/trace.axd
Answer: F

You are creating an ASP.NET application for BMW. Customers will use the application to file claim forms online.You plan to deploy the application over multiple servers. You want to save session state information to optimize performance.What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Modify the Web.config file to support StateServer mode.
B. Modify the Web.config file to support SQLServer mode.
C. Modify the Web.config file to support InProc mode.
D. In the Session_Start procedure in the Global.asax file, set the EnableSession property of the WebMethod attribute to true.
E. In the Session_Start procedure in the Global.asax file, set the Description property of the WebMethod attribute to sessionState.
Answer: A, B

You are creating an ASP.NET application for BMW’s Internet Web site. You want to create a toolbar that will be displayed at the top of each page in the Web site. The toolbar will contain only static HTML code. The toolbar will be used in only your application.Your plan to create the toolbar as a reusable component for your application. You need to create the toolbar as quickly as possible.What should you do?
A. Create a new Web Control Library project.
Create the toolbar within a Web custom control.
B. Add a new Web user control to your ASP.NET project.
Create the toolbar within the Web user control.
C. Add a new Web Form to your ASP.NET project.Use HTML server controls to design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D. Add a new component class to your ASP.NET project.Use HTML server controls to design the toolbar within the designer of the component class.
Answer: B

You are creating an ASP.NET page for BMW. You create a DataGrid control that displays past purchases made by the user. The DataGrid control is populated from an existing database when the page is created.The page contains TextBox controls that allow users to update their personal information, such as address and telephone number.You need to ensure that the page is refreshed as quickly as possible when users update their contact information.What should you do?
A. Set the Enabled property of the DataGrid control to false.
B. Set the EnableViewState property of the DataGrid to false.
C. Write code in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is false.
D. Write in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is true.
Answer: D

You create a new ASP.NET application named TestKSalesReports on your development computer. You add code to the default WebForm1. To test the code’s functionality, you copy the entire TestKSalesReports folder from the C:\inetpub\wwwroot folder on your computer to the C:\inetpub\wwwroot folder on a separate Microsoft Windows 2000 Server computer named BMW1. BMW1 hosts several ASP.NET applications.When you use the browser on your computer to open the copy of the application hosted on BMW1, you receive the following error message: “It is an error to use a section registered as allowDefinition=”MachineToApplication’ beyond application level.” You want to correct this error without altering the other Web sites that are hosted on BMW1.What should you do?
A. Use Internet Information Services (IIS) to create a virtual directory that points to the TestKSalesReports folder on BMW1.
B. Remove the following element from the Web.config file in C\inetpub\wwwroot\TestKSalesReports on BMW1:<authentication mode=”Windows” />
C. Remove the following element from the Web.config file in C:\inetpub\wwwroot on BMW1:<authentication mode=”Windows” />
D. Move the TestKSalesReports folder on BMW1 up one level, so that it is a subfolder of the inetpub folder.
Answer: B

You create an ASP.NET page named BMWCalendar.aspx that shows scheduling information for projects in your company. The page is accessed from various other ASP and ASP.NET pages hosted throughout the company’s intranet. All employees on the intranet use Internet Explorer.BMWCalendar.aspx has a Calendar control at the top of the page. Listed below the Calendar control is detailed information about project schedules on the data selected. When a user selects a date in the calendar, the page is refreshed to show the project schedule details for the newly selected date.Users report that after viewing two or more dates on BMWCalendar.aspx, they need to click the browser’s Back button several times in order to return to the page they were viewing prior to accessing BMWCalendar.aspx.You need to modify BMWCalendar.aspx so that the users need to click the Back button only once.What should you do?
A. Add the following statement to the Page.Load event handler for BMWCalendar.aspx:Response.Expires(0);
B. Add the following statement to the Page.Load event handler for BMWCalendar.aspx:Response.Cache.SetExpires (DateTime.Now());
C. Add the following attribute to the Page directive for BMWCalendar.aspx:EnableViewState=”True”
D. Add the following attribute to the Page directive for BMWCalendar.aspx:SmartNavigation=”True”
Answer: D

You are creating a new ASP.NET page named ItemList that displays item and price information for many different items. When a user logs on to the Web site, the page retrieves the current list of prices from a database. ItemList will be accessed by several thousand registered users.When a price list is retrieved for a user, the prices remain valid for as long as the user continues to access the page. Users are allowed to keep the same price list for several days.
When ItemList is posted back to the server, you want to ensure that the price list was not altered on the user’s computer. You also want to minimize the memory resources consumed on the Web server.Which three parameters should you add to the Page directive in ItemList? (Each correct
answer presents part of the solution. Choose three)
A. EnableSessionState=”True”
B. EnableSessionState=”False”
C. EnableSessionState=”ReadOnly”
D. EnableViewState=”True”
E. EnableViewState=”False”
F. EnableViewStateMac=”True”
G. EnableViewStateMac=”False”
Answer: B, D, F

You create an ASP.NET application named MyApp that will be installed on a Web server named BMWSrv.You create a Web setup project to deploy your ASP.NET application and add it to your solution. You set the Configuration Manager to Release mode and create a deployment package for your application. You copy the deployment package to a CD-ROM and take it to BMWSrv.You log on to BMWSrv and run the deployment package from your CD-ROM. During the setup process, you receive the following error message. “The specified path “http://BMWSrv/MyApp’ is unavailable. The Internet Information Server might not be running or the patch exists and is redirected to another machine. Please check the status of the virtual directory in the Internet Service Manager”.You verify that Internet Information Services (IIS) is running on BMWSrv and that the specified path does not exist. You want to install the application on BMWSrv.What should you do?
A. Launch the deployment package in Administrative mode by using the /a command line option.
B. Log off and log on again by using an account that has Administrator privileges on BMWSrv.
C. Create an ISS virtual directory named MyApp and configure it with Write permissions.
D. Copy the deployment package from the CD-ROM to a local folder on BMWSrv and then run the deployment package.
Answer: C

You are a Web developer for Techno Inc. 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 TestK01.The company purchases a factory automation software application. The application is installed
on TestK01, 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. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on TestK01.Which string should you use?
A. Server=TestK01;Data Source=Factory;<br>Initial Catalog=FactoryDB;Integrated Security=SSPI
B. Server= TestK01;Data Source=Factory;<br>Database=FactoryDB;Integrated Security=SSP1
C. Data Source= TestK01\Factory;Initial Catalog=Factory;<br>Integrated Security=SSP1
D. Data Source= TestK01\Factory;Database=FactoryDB;<br>Integrated Security=SSP1
Answer: D

You are creating an ASP.NET application for Techno Inc's Internet Web site. You want to create a toolbar that will be displayed at the top of each page in the Web site. The toolbar will contain only static HTML code. The toolbar will be used in only your application.You plan to create the toolbar as a reusable component for your application. You need tocreate the toolbar as quickly as possible.What should you do?
A. Create a new Web Control Library project.Create the toolbar within a Web custom control.
B. Add a new Web user control to your ASP.NET project.Create the toolbar within the Web user control.
C. Add a new Web Form to your ASP.NET project.Use HTML server controls to design the toolbar within the Web Form and save the Web Form with an .ascx extension.
D. Add a new component class to your ASP.NET project.Use HTML server controls to design the toolbar within the designer of the component class.
Answer: B

You ASP.NET application manages order entry data by using a DataSet object named TKorderEntry. The TKorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?
A. The current value of OrderDetails.KeyDeleteRule is Rule.Cascade.
B. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.
C. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault.
D. The current value of OrderDetails.KeyDeleteRule is Rule.None.
Answer: D

You are creating an ASP.NET application to track sales orders for Techno Inc Ltd. The application uses an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders, and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order.What should you do?
A. Add a DataRelation object to the Relations collection of the DataSet object.
B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other.
C. Add a ForeignKeyConstraint to the OrderDetails table.
D. Add a keyref constraint to the OrderDetails table.
Answer: A

You create an ASP.NET application to display a sorted list of products in a DataGrid control.The product data is stored in a Microsoft SQL Server database named Techno Inc Products.Each product is identified by a numerical value named ProductID, and each product has an alphabetic description named ProductName. You write ADO.NET code that uses a SqlDataAdapter object and a SqlCommand object to retrieve the product data from the database by calling a stored procedure.You set the CommandType property of the SqlCommand object to CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully fills a DataTable object with a list of products that is sorted by ProductID in descending order.You want to data to be displayed in reverse alphabetic order by ProductName.What should you do?
A. Change the CommandType property setting of the SqlCommand object to CommandType.Text.Change the CommandText property setting of the SqlCommand object to the following: SELECT * FROM procProductList ORDER BY ProductName DESC; Bind the DataGrid control to the DataTable object.
B. Create a new DataView object based on the DataTable object. Set the Sort Property of the DataView object to “ProductName DESC”. Bind the DataGrid control to the DataView object.
C. Set the AllowSorting property of the DataGrid control to True. Set the SortExpression property of the DataGridColumn that displays ProductName to “ProductName DESC”.Bind the DataGrid control to the DataTable object.
D. Set the DisplayExpression property of the DataTable object to “ORDER BY ProductName DESC”.Bind the DataGrid control to the DataTable object.
Answer: B

You create an ASP.NET application and deploy it on a test server named Techno IncSrv. The application consists of a main page that links to 30 other pages containing ASP.NET code.You want to accomplish the following goals: • Enable tracing on all the pages in the application except the main page.; • Display trace output for up to 40 requests.;• Ensure that trace output is appended to the bottom of each of the pages that willcontain trace output.;• Ensure that any configuration changes affect only this application.You need to accomplish these goals with the minimum amount of development effort. Which three actions should you take? (Each correct answer presents part of the solution. Choose three)
A. Add the following element to the Web.config file: &lt;trace enabled=”true” pageOutput=”True”/&gt;
B. Add the following attribute to the Trace element of the application’s Web.config file: requestLimit=40
C. Add the following attribute to the Trace element of the application’s Machine.config file: RequestLimit=40
D. Set the Trace attribute of the Page directive to true for each page except the main page.
E. Set the Trace attribute of the Page directive to false for the main page.
F. Set the TraceMode attribute of the Page directive to SortByTime for the main page.
Answer: A, B, E

You are creating an ASP.NET page for Techno Inc. The page uses string concatenation to gather data from multiple e-mail messages and format the data for display on the page.You want to ensure that the page displays as quickly as possible.What should you do?
A. Write code that uses the Append method of the StringBuilder object.
B. Write code that uses the Substring method of the String object.
C. Write code that uses the Concat method of the String object.
D. Write code that uses the plus-sign (+) operator to concatenate the strings.
Answer: A

You are creating an ASP.NET application that uses the Microsoft SQL Server .NET Data Provider to connect to Techno Inc’s database. Your database administrator reports that, due to heavy usage of the application, data requests are being blocked while users wait for new connections to be created.You want to improve throughput by setting a minimum connection pool size of 10.What should you do?
A. Add a connection element under an appSettings element in the Web.config file for your application, and specify a minimum size of 10 for the connection pool.
B. Add a connection element under an appSettings element in the Machine.config file on your Web server, and specify a minimum size of 10 for the connection pool.
C. Add a Min Pool Size property to the connection string you use when opening a connection,and specify a minimum size of 10 for the connection pool.
D. Add a Min Pool Size property to your ADO.NET connection objects, and assign a value of 10 to the property.
Answer: C

You create an ASP.NET application named TKProject on your client computer. The application has a page named ProjectCalendar.aspx. This page is located in a virtual directory named Scheduling, which is a child of the TKProject root directory. ProjectCalendar.aspx uses cookies to track modifications to the schedule during a user’s session so that the user can undo modifications if necessary. You deploy your application on a computer named Techno Inc1. Users report that the undo functionality stops working after they execute a specific sequence of actions. You need to view the cookie values after the sequence of actions to help identify the cause of the problem.You add the following element to the Web.config file:&lt;trace enabled=”true” pageOutput=”false”/&gt;You want to display the trace output information on your client computer.Which URL should you use?
A. HTTP://Techno1/TKProject/Scheduling/ProjectCalendar.aspx?Trace=true
B. HTTP://Techno1/TKProject/Scheduling/ProjectCalendar.aspx?trace.axd
C. HTTP://Techno1/TKProject/Scheduling/ProjectCalendar.aspx
D. HTTP://Techno1/TKProject/ProjectCalendar.aspx?trace.axd
E. HTTP://Techno1/TKProject/ProjectCalendar.aspx?trace.axd
F. HTTP://Techno1/TKProject/trace.axd
G. HTTP://Techno1/TKProject/Scheduling/trace.axd
Answer: F

You are creating an ASP.NET application for your company Techno Inc. Techno Inc data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a way that achieves this goal.What should you do?
A. Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored procedure that returns the data.
B. Use an OleDbConnection object to connect to the database, and use an OleDbCommand object to run a stored procedure that returns the data.
C. Configure SQL Server to support HTTP access, and create an XML template to run a stored procedure that returns the data in XML format.
D. Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object to run a SQL statement that returns the data.
Answer: B

You are creating an ASP.NET page to retrieve sales data from a Microsoft SQL Server database named GsoftDB. You are writing a method named GetYTDSales to run a stored procedure in the SQL Server database. The stored procedure has one input parameter that is used to specify a product. The stored procedure returns to the year-to-date sales for that product.You declare a numeric variable in the GetYTDSales method. You want to assign the return value of the stored procedure to the variable.What should you do?
A. Create a SqlDataAdapter object and call its Fill method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
B. Create a SqlDataAdapter object and call its Update method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
C. Create a SqlCommand object and call its ExecuteScalar method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
D. Create a SqlCommand object and call its ExecuteReader method to run the stored procedure and assign the year-to-date sales value to your numeric variable.
Answer: C

You are developing an ASP.NET application for Gsoft’s intranet. Employees will use the application to administer their employee benefits. The benefits information is stored in a Microsoft SQL Server database named Benefits.An employee can select benefit options from 10 different drop-down list boxes. The values for each list are stored in separate tables in the Benefits database. The values that are available for employees to choose can change once each year during the benefits enrollment period.You want to minimize the number of times your application must access the Benefits database to obtain the values for the drop-down list box.Which two courses of action should you take? (Each correct answer presents part of the solution. Choose two).
A. Create one stored procedure that returns the result for all 10 drop-down list boxes.Create one DataTable object for each of the 10 drop-down list boxes.Use a SqlDataReader object to populate 10 DataTable objects by calling the NextResult() method.Bind the drop-down list boxes to the DataTable objects.
B. Create a stored procedure that returns the result set for all 10 drop-down list boxes.Bind the drop-down list boxes to the DataReader object.
C. Create one DataTable object for each of the 10 drop-down list boxes.Create a stored procedure for each of the 10 tables.Use a SqlDataReader object to populate the 10 DataTable objects.Bind the drop-down list boxes to the DataTable objects.
D. Store the result sets for the 10 drop-down list boxes in a DataSet object.Add the DataSet object to the Cache object for the application.
E. Store the result sets for the 10 drop-down list boxes in a file on the user’s computer by using the DataSet.WriteXml() method.
Answer: A, D

You are creating an ASP.NET page that displays a list of products. The product information is stored in a Microsoft SQL Server database. You use SqlConnection object to connect to the database.Your SQL Server computer is named GsoftSrv. The database that contains the product information is named SalesDB. The table that contains the product information is named Products. To connect to SalesDB, you use a SQL Server user account named WebApp that has
the password Kn123.You need to set the ConnectionString property of the SqlConnection object.Which string should you use?
A. “Provider=SQLOLEDB.1;File Name =”Data\MyFile.udl
B. “Provider=MSDASQL;Data Source=Gsoft Srv; Initial Catalog=SalesDB; User ID=WebApp;Password= Kn123”
C. “Data Source= Gsoft Srv;Initial Catalog=SalesDB; User ID=WebApp;Password= Kn123”
D. “Data Source= Gsoft Srv;Database=SalesDB; Initial File Name=Products;User ID=WebApp;Pwd=Kn123”
Answer: C

You are using ASP.NET and ADO.NET to create an accounting application for Gsoft. You are writing code to run a set of stored procedures that perform posting operations in a database at the end of each month.You use an OleDbConnection object to connect to the database. You use an OleDbCommand object to run the stored procedures.If an error occurs during execution of any of the stored procedures, you want to roll back any data changes that were posted. You want the changes to be committed only of all of the posting operations succeed.You write code to catch an OleDbException object if an error occurs during the execution of a stored procedure.What else should you do?
A. Call the BeginTransaction method of the OleDbConnection object before running the stored procedure.If an error occurs, use the OleDbConnection object to roll back the changes.
B. Call the BeginTransaction method of the OleDbConnection object before running the stored procedures.If an error occurs, use the OleDbException object to roll back the changes.
C. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Assign the OleDbTransaction object to the Transaction property of your OleDbCommand object.If an error occurs, use the OleDbTransaction object to roll back the changes.
D. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.Pass a reference to the OleDbTransaction object to each stored procedure.Use error handling inside the stored procedures to roll back the changes.
Answer: C

As a software developer at Gsoft Inc. you are creating an ASP.NET application that uses role-based security to allow users to access only those pages that they are authorized to access.You use a Microsoft SQL Server database to manage the list of users and roles for the ASP.NET application. A table named Roles contains a column named RoleID and a column named RoleName. A table named Users contains a column named UserID, a column named UserName, and a column named Password. A table named UserRoles contains a column named UserID and a column named RoleID.You need to create a stored procedure that returns all users who belong to a specific role. You write the following Transact-SQL code to define the stored procedure: CREATE PROCEDURE GetRoleMembers @RoleID int AS Which code segment should you use to complete the stored procedure?
A. SELECT UserRoles.UserID, Users.UserName FROM Users INNER JOIN Roles UserRoles On UserRoles.RoleID = Users.UserID WHERE UserRoles.RoleID = @RoleID
B. SELECT UserRoles.UserID, Users.UserName FROM UserRoles INNER JOIN Roles On UserRoles.RoleID = Roles.RoleID, Users WHERE UserRoles.RoleID = @RoleID
C. SELECT UserRoles.UserID, Users.UserName FROM UserRoles INNER JOIN Users
   On Users.UserID = UserRoles.UserID WHERE UserRoles.RoleID = @RoleID
D. SELECT Users.UserID. Users.UserName FROM Users, UserRoles INNER JOIN Roles On UserRoles.RoleID = Roles.RoleID WHERE UserRoles.RoleID = @RoleID
Answer: C

What is a satallite assembly ?
A. Any DLL file used by an EXE file.
B. An Assembly containing localized resources for another assembly
C. None of the above
ANSWER: B

What is MSIL?
A. Multi Socket Interface Library
B. Microsoft Intermediate Language
C. Microsoft Interface Language
D. Microsoft Integer Long
Answer:B

An assembly is:
A. A collection of files that appear to the programmer to be a single DLL or EXE.
B. properties of c#
C. events Of c#
D. declarative syntax of Java
Answer:A

Which of the following method is used to obtain details about information types of assembly?
A. GetTypes
B. GetType
C. Both A and B
D. None of the Above
ANSWER: C

Suppose a .NET programmer wants to convert an object into a stream of bytes then the process is called
A. Serialization
B. Threading
C. RCW
D. AppDomain
ANSWER: A

GIVE ONE WORD: In .NET the operation of reading metadata and using its contents is known as
A. Reflection
B. Enumeration
C. Binding
D. Serialization
ANSWER: A

Which Namespace is used for event log support
A. System.Reflection;
B. System.Diagnostics
C. System.Collections
D. System.Web.UI
ANSWER: B

Is it possible to inline assembly or IL in C code?
A. Yes
B. No
ANSWER: B

Which are the components of a strong name?
A. Name of the assembly
B. version number
C. Culture identity
D. public key token.
E. All of these
ANSWER: E

In order to get assembly info which namespace we should import?
A. system.reflection   
B. System.Collections.Generic            
C. System.Configuration
D. System.assembly
ANSWER: A

Assemblies are the building blocks of the .NET framework
A. True
B. False
ANSWER: A

What does the metadata in assembly contain?
A. Version Information
B. Complete description of methods and types
C. Manifest.
D. All of the above
ANSWER : D

What’s the .NET collection class that allows an element to be accessed using a unique key?
A. List
B. HashTable 
C. ArrayList
D. Arry
ANSWER: B

What’s the top .NET class that everything is derived from?
A. System.Object 
B. System
C. System.Data
D. System.net
ANSWER: A

What does Manifest contain?
A. Identification information
B. Public types and a list of other used assemblies
C. Both A & B
D. None of the above
ANSWER : C

Which tool is used to display the metadata of the .net programs or libraries?
A.  Intermediate Language Disassembler
B. CLR
C. JIT compiler
D. None of the above.
ANSWER : A

Manifest is a part of Metadata.
A. True
B. False    
ANSWER : A

Application domain is a way in CLR to maintain a boundary between various applications to ensure that they do not interfere in working of any other application.
A. True
B. False
ANSWER: A

Session object is accessible  in
A. web farm
B. web garden 
C. both 
D. none
ANSWER: C

Application object is accessible  in
A. web farm 
B. web garden 
C. both 
D. none
ANSWER: A

Thread is a
A. instance method   
B. object  
C. event  
D. static method
ANSWER: A

Currency object is used in
A. forms 
B. controls 
C. both 
D. none
ANSWER: A

Named pipes ( refer asp.net archi) allows multiple http modules
A. true
B. false
ANSWER: A

Currency managers of a binding context are bound to
A. form 
B. controls 
C. both 
D. done
ANSWER: A

Automatic paging is possible in
A. datareader
B. dataset
C. datatable
D. all
ANSWER: C

Which cannnot be initialised with new key word
A. datatable
B. datareader
c. datacolumn
ANSWER: B

In data reader, what can be used before read method?
A. Getstring
B. Getvalue
C. GetNumber
D. None
ANSWER: D

Indexer can be overloaded.
A. True
B. False
ANSWER: A

Paybill.aspx file is used to collect customer contact information like name, address phone no and credit card details. User can select change address option. If user selects changes address option then changeaddress.aspx page will be called after submitting page paybill.aspx. There isn’t any user interface on changeaddress.aspx. After processing changeaddress.aspx page, success message will be displayed on paybill.aspx. we need to write one line of code to process changeaddress.aspx page. This line should be:
A. Response.redirect (“changeaddress.aspx”)
B. Server.transfer(“changeaddress.aspx”)
C. Server.writefile(“changeaddress.aspx”)
D. Server.execute(“changeaddress.aspx”)
ANSWER: D

From a dataview dv who has a column “EmpNo” from employee table, how will u bind a textbox
A. Textbox.databinding.add(“Text”,dv,”EmpNo”);
B. Textbox.databinding.adddv,”EmpNo”);
C. Textbox.databinding.add(EmpNo”);
D. None of the above
ANSWER: A

Connection pool for______________ Reasons?
A. When only Close() connection is called
B. When only Dispose() connection is called
C. When Connection lifetime is expired
D. When any one of the given choices are true.
ANSWER: D

To invoke Fill() method of a DataAdapter object
A. The connection should be opened
B. The DataAdapter object should have SelectCommand
c. None of the options are valid
ANSWER: A

The uniqueId that gets generated at the start of the Session is stored in
A. Client computer as a cookie
B. Server machine
C. Passed to and fro on each and every request and response
D. Both a and b are correct
ANSWER: B

A master page is merged with a content page  ________ in the page execution life cycle
A.Very early
B.Very late
ANSWER: A

Which property will you use to process different server paths in a page
A. Request
B. Response
C. Server
D. Application
ANSWER: C

IIS server needs to be stopped before deploying a new version of an assembly.
A. True
B. False
ANSWER: B
 
The page class file is generated.
A. Every time a page is accessed
B. Whenever the assembly is recompiled and deployed
C. Whenever the configuration settings are changed
ANSWER: B

Which of the following component does the formatting and conversion part of crystal reports?
A. Report designer
B. Reports engine
C. Report viewer
D. Object Models
ANSWER: B

Can crystal reports be published as a web service?
A. Yes
B. No
ANSWER: A

Crystal Report can run on Apache.
A. True
B. False
ANSWER: A

Is it possible to export crystal report with linked subreports in one excel sheet?
A. Yes
B. No
ANSWER: A

Can we create report using more than one database?
A. Yes
B. No
ANSWER: A

If database field length is more than 255 characters, then a formula cannot be created by using that field.
A. True
B. False
ANSWER: A

Which version of Crystal Report provides the feature "XML export with embeddable XSL transforms"?
A. Crystal Reports 10.5
B. Crystal Reports 12
C. Both
D. None
ANSWER: C

In order to display page-wise total in each page, which of the following could be used?
A. Sub Total
B. Running Total
C. Both
D. None
ANSWER: B

No comments:

Post a Comment