单项选择题你正在创建一个 Web 应用。你在 Web.config 文件中增加了如下的配置: 请问,你在代码中如何引用连接字符串?()

A.ConfigurationManager.ConnectionStrings.MyDB
B.ConfigurationManager.ConnectionStrings.System.Data.SqlClient
C.ConfigurationManager.ConnectionStrings[";MyDB";]
D.ConfigurationManager.ConnectionStrings[";System.Data.SqlClient";]


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题你在创建一个 Web 窗体。这个 Web 窗体允许用户计算值并在名为 lblResults 的 Label 控件中显示结果。你需要在 Web 窗体通过 Error 事件截获所有未处理的异常并显示异常在 Web 窗体上。你可以使用下面那个代码段实现?()

A. protected void Page_Error(object sender, EventArgs e) { lblResults.Text = e.ToString();e=null;}
B. protected void Page_Error(object sender, EventArgs e) { lblResults.Text =Server.GetLastError().ToStri();Server.ClearError();}
C. protected void Page_Error(object sender, EventArgs e) Response.Write(e.ToString());e=null;}
D. protected void Page_Error(object sender, EventArgs e) Response.Write(Server.GetLastError().ToString()); Server.ClearError();}

3.单项选择题你的 Web 站点使用自定义主题,并且要求站点必须支持额外的基于公司名称的主题。公司名称在用户登录到 Web 站点时进行设置。公司的主题名存储在变量 ThemeName 中。你需要使用这个变量动态的设置 Web 站点的主题,你应该如何做?()

A.在Web站点的每个页面的声明标记中增加<%@pagetheme=”themename”…%>
B.在Web站点的每个页面的Load事件中增加Page.Theme=ThemeName;
C.在Web站点的每个页面的PreInit事件中增加Page.Theme=ThemeName;
D.在Web站点的配置文件中增加

4.单项选择题你正在创建一个 Web 窗体。它包含一个让用户关闭页面的按钮 btnCancel。当用户单击这个按钮的时候需要跳过验证。在测试过程中,你发现单击 Cancel 按钮并不能关闭页面。你需要确保用户始终能够关闭页面,你应该如何做?()

A. 设置Web窗体上验证控件的Enabled 属性为False。
B. 设置btnCancel 按钮的CausesValidation 属性为False.
C. 设置btnCancel 按钮的CausesValidation 属性为True.
D. 设置Web窗体上验证控件的Visible 属性为False。

5.多项选择题你正在开发一个使用 SqlConnection 对象连接到 Microsoft SQL Server 数据库的应用。你的连接对象正在使用连接池。当连接池满的时候请求将被排队或者某些连接请求可能被拒绝。你需要确保应用能够尽早的释放连接给连接池。因此,为了减少连接被拒的可能性,你应该从下面那三个方法着手解决?()

A. 确保完成执行后调用每个连接对象的Close方法。
B. 确保完成执行后每个连接对象保持打开状态。
C. 在连接字符串内增加Max Pool Size的值。
D. 在连接字符串内增加Min Pool Size的值。
E. 在连接字符串内增加Connection Lifetime的值。
F. 增加SqlConnection对象的ConnectionTimeout属性的值。

7.单项选择题你有一个需要大约执行一分钟的 SQL 查询。为此,你使用如下的代码段异步执行这个查询:IAsyncResult ar = cmd.BeginExecuteReader()。当上面SQL查询在执行的过程中,你需要同时执行一个方法Do Work(),这个方法大约需要1秒钟的执行时间。而且在SQL 查询执行的过程中需要尽可能的多次执行Do Work()方法,你应该使用下面那个代码段?()

A. while (ar.AsyncWaitHandle == null) { DoWork();}dr = cmd.EndExecuteReader(ar);
B. while (!ar.IsCompleted) { DoWork();}dr = cmd.EndExecuteReader(ar);
C. while (Thread.CurrentThread.ThreadState == ThreadState.Running) { Do Work();}dr =cmd.EndExecuteReader(ar);
D. while (!ar.AsyncWaitHandle.WaitOne()) { DoWork();}dr = cmd.EndExecuteReader(ar);

8.单项选择题你正在创建一个应用。这个应用每分钟处理上百个 XML 文档。XML 文档使用在线的架构进行验证。你需要尽可能快的从文件系统装载并读取 XML 文档。要求,在读取 XML 文档的时候要忽略 XML 注释内容。你应该如何做?()

A. 通过使用带有XmlReaderSettings 参数的XmlReader 的Create方法创建一个XmlReader 实例。
B. 使用XmlTextReader 参数创建一个XmlReader 实例。
C. 创建一个XmlDocument 实例并且指定架构的位置。
D. 使用XmlNodeReader参数创建一个XmlReader 实例。

9.单项选择题你正在从一个数据库到另一个数据库进行数据传送。你需要决定是否可以使用 SqlBulkCopy去传送数据。你应该如何做?()

A. 保证源数据库是Microsoft SQL Server.
B. 保证目标数据库是 Microsoft SQL Server.
C.确保源表和目的表的列名称相同。
D.确保在目标机器上安装有bcp工具。


最新试题

You have a Web application that is configured for personalization. You need to access personalization data from one of the pages of the Web application by using the minimum amount of administrative effort.What should you do? ()

题型:单项选择题

You create a mobile Web application. You need to use a Command control to post user input from the UI elements back to the server.What are two possible ways to achieve this goal?()

题型:多项选择题

You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database. When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields. You need to ensure that the Web Form does not update if the user has not entered data in all of the fields.Which code segment should you use?()

题型:单项选择题

You create a Web site for a customer. You need to deploy the Web site to the customers server without any of the source files for the Web site. You do not want the customer to be able to update any of the static pages on the Web site.Which tool should you use?()

题型:单项选择题

You create a Web site that is for members only. The behavior of the Web site changes according to the role of the user. The Web site uses the ASP.NET Membership control for creation of user accounts. You need to find out whether a user is a member of a particular role.What should you do?()

题型:单项选择题

You need to turn on Tracing for a page that is not performing well. You must store the trace information in a database for reporting and trending.Which two actions should you perform?()

题型:多项选择题

You are developing a product search page named Search.aspx for Web application that will be integrated into Certkiller .com's existing e-Commerce Web site. The Search.aspx page allows customers search for products that match specific criteria. Once a product is located, you want an image of the product to be displayed. You want to use an Image control to display the image. You want to configure the Image control to display a description of the image if the image cannot be displayed in the customer's Web browser.What should you do?()

题型:单项选择题

You create a server control that inherits from WebControl. You need to enable the server control to emit markup for a new kind of mobile device. You must not alter the code in the server controls.Which two actions should you perform?()

题型:多项选择题

Certkiller .com's e-Commerce Web application contains a page named Products.aspx that uses data source and data-bound server controls. Customers use the server controls to search for products. The Products.aspx page does not have an associated code-behind file. You need to convert the Products.aspx page to a user control so that its functionality can be reused on other pages.What should you do?()

题型:多项选择题

You are developing a page named Products.aspx in a Web application that contains three DropDownList controls that are dynamically loaded from a SQL Server 2005 database file. The DropDownList controls represent a vendor list, a certification list, and an exam list. Certkiller .com customers use the Products.aspx page to select exams related to particular certifications on offer from a particular vendor. A Go button initiates the selection. Each DropDownList control has an associated RequiredFieldValidator control.Whenever the customer selects a vendor, and the vendor offers certifications, then the customer must also select a certification if the. If the vendor only offers exams and not certifications, the certification list should remain hidden. Whenever the customer selects a certification, the customer must also select an exam. Validation error messages should only be displayed when the Go button is clicked. You need to set properties on the vendor DropDownList control.What should you do?()

题型:单项选择题