ASP. Microsoft Certified New Exam question Bank and answer 1

Source: Internet
Author: User

1. You created an ASP. NET application that will run on the TK company web site. Your application consists of 100 Web pages. You want to configure your application to display a custom error message to the user when an HTTP code error occurs. At the same time you want to log in when a program error occurs. Do you want to accomplish this goal with minimal configuration impact, and the next two things you have to do? (select two items) (AD)

A. Create the Application_Error procedure in the Global.asax file for the application to control the ASP error;

B. Create the Application_Error procedure in the Web. config file for the application to control ASP.

C. Create an Customerros event in the Global.asax file for the application to control HTTP errors;

D. Create the Customerros procedure in the Web. config file for the application to control HTTP errors;

E. Add page directives to each page in the application to control the error of controlling ASP.

F. Add page directives to each page in the application to control HTTP errors;

Note: The Web. config file does not have a application_error process so B is wrong, and C is wrong. E, F has nothing to do with the subject.

2. You created an ASP. NET application for TK, an early version of the application that uses an ActiveX component written in VB6.0. The new ASP. NET application will continue to use this ActiveX component. You want to make the data collection between your ASP. NET application and ActiveX components as fast as possible. Which of the following two actions should you choose? (CD)

A, with ODBC binding;

B, using late binding;

C, using early binding;

D. Set the ASPCompat property in page directive to true;

E, set the ASPCompat property in page directive to False

Note: When set to true, the ASPCompat property allows the page to be executed on a single-threaded apartment (STA) thread. This allows the page to invoke the STA component, such as a component developed with Microsoft Visual Basic 6.0. Setting this property to True also allows the page to invoke the COM + 1.0 component, which requires access to unmanaged Active Server Pages (ASP) built-in objects. By the meaning of the subject, you must choose D. ODBC binding is an old way of binding, very slow has been replaced by SQL and OLE DB, B, C can achieve the goal of the subject, but the binding method of the C-item performs better.

3. You created an ASP. NET application to publish customized news content. Users can make selections on an ASP. Your code creates a DataSet object named Tknewsitems that contains news items that are displayed according to the criteria selected by the user. You use HTML to create a style sheet named newsstyle.xsl to report data in Tknewsitems. You have written the following code snippet:

Do you want to display the transmitted data in HTML text format, and the following code should be added to the last code snippet above? A

C D: Is output in XML file;

Transform method: Provide the object for conversion data;

Note: The XslTransform.Transform method is used to transform XML data using the loaded XSLT style sheet. Because the subject is to configure the data, not to read the data so select a, do not select B

4. You created an ASP. NET application that uses the DataGrid control to display the stored product list information. The product database is stored in a SQL Server database named TESTKINGDB. Each product uses a numeric field identifier named ProductID, and each product has a character field named ProductName. You write the ADO code, using the SqlDataAdapter object and the SqlCommand object to fetch data from the database by calling the stored procedure. You set the CommandType property of the SqlCommand object to the Commandtyp.storedprocedure,commandtext property to Procproductlist. Your code, using the product list data in descending order of the ProductID field, successfully populated a DataTable object. You want to use the data to re-display the ProductName field in alphabetical order, what should you do? B

A. Change the CommandType property of the SqlCommand object to CommandType.Text; Change the CommandText property of the SqlCommand object to the following code: Bind the DataGrid control to the DataTable object;

B, create a DataView object on the basis of the DataTable object; Set the Sort property of the DataView object to: "ProductName DESC"; Bind the DataGrid control to the DataView object; to reorder, Do not change the original display order; You can use the DataView object, which only changes the in-memory data sorting; does not change the data source;

C. Set the AllowSorting property of the DataGrid control to true; set the SortExpression of DataGridColumn to display ProductName using "ProductName DESC" ; bind a DataGrid control to a DataTable object;

D, set the Displayexpression property of the DataTable object to be: Bind the DataGrid control to the DataTable object;

Note: The Sort property: Gets or sets one or more DataView and sort order

AllowSorting property: Gets or sets a value that indicates whether the grid can be reordered by clicking the column header.

Displayexpression property: Gets or sets an expression that returns a value that is used to represent the table in the user interface

The root of the problem is the sort of data sources, a,c,d three items can not achieve the objective.

ASP. Microsoft Certified New Exam question Bank and answer 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.