多项选择题You are creating a Web Form. You write the following code segment to create a SqlCommand object. SqlConnection conn = new.SqlConnection(connString); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = “select cont(*) from Customers”; You need to display the number of customers in the Customers table. Which two code segments can you use to achieve this goal? ()

A. object customerCount = cmd.ExecuteScalar();lblCompanyName.Text = customerCount.ToString();
B. int customerCount = cmd.ExecuteNonQuery();lblCompanyName.Text = customerCount.ToString();
C. SqlDataReader dr = cmd.ExecuteReader();dr.Read();lblCompanyName.Text = dr[0].ToString();
D. SqlDataReader dr = cmd.ExecuteReader();dr.Read();lblCompanyName.Text = dr.ToString();


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题You are transferring records from one database to another. You need to decide whether you can use the SqlBulkCopy class to transfer the records. What should you do? ()

A. Ensure that the source database is Microsoft SQL Server.
B. Ensure that the destination database is Microsoft SQL Server.
C. Ensure that the column names in the source table match the column names in the destination table.
D. Ensure that the bulk copy program (bcp) utility is installed on the destination server.

2.多项选择题Your Web site processes book orders. One of the application methods contains the following code segment. XmlDocument doc = newXmlDocument(); doc.LoadXml(“10”+” Dictionary”); You need to remove the discount element from XmlDocument. Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. ()

A. XmlNode root = doc.DocumentElement;root.RemoveChild(root.FirstChild);
B. XmlNode root = dec.DocumentElement;root.RemoveChild(root.SelectSingleNode(“discount”));
C. doc.RemoveChild(doc.FirstChild);
D. doc.DocumentElement.RemoveChild(doc.FirstChild);

3.多项选择题You create a Web Form that contains a TreeView control. The TreeView control allows users to navigate within the Marketing section of your Web site. The following XML defines the site map for your site. You need to bind the TreeView control to the site map data so that users can navigate only within the Marketing section. Which three actions should you perform?()

A. Add a SiteMapDataSource control to the Web Form and bind the TreeView control to it.
B. Add a SiteMapPath control to the Web Form and bind the TreeView control to it.
C. Embed the site map XML within the SiteMap node of a Web.sitemap file.
D. Embed the site map XML within the AppSettings node of a Web.config file.
E. Set the StartingNodeUrl property of the SiteMapDataSource control to ~/Marketing.aspx.
F. Set the SkipLinkText property of the SiteMapPath control to Sales.


4.单项选择题

Exhibit: You are developing a Web application. The Web application uses a GridView control to display data. You build your Web Forms for the Web application by dragging and dropping tables from the Data Connections tree in Server Explorer. You need to add a connection to your data by using the Add Connection dialog box as shown in the exhibit. During the process, you need to configure the .NET Data Provider that you use to create the data source objects. What should you do?()

A. Right-click the connection, and click Properties. Modify the Provider property of the data connection.
B. Click the Change button, and change the data provider for the selected data source.
C. Click the Advanced button, and change the Data Source property to the target provider.
D. Click the Advanced button, and change the Application Name property to the target provider.


5.多项选择题You load an XmlDocument named doc with the following XML. Dictionary World Atlas You need to change the value for the genre attribute to NA for all book attributes. First, you add the following code segment to your class. XmlElement root = doc.DocumentElement; XmlNodelist nodes = root.SelectNodes(“books/book”); Which additional two code segments can you use to achieve this goal? ()

A. foreach (XmlNode node in nodes){ node.Attributes[0].Value = “NA”;}
B. foreach (XmlNode node in nodes){ node.Attributes[1].Value = “NA”;}
C. foreach (XmlNode node in nodes){XmlNode genre = node.SelectSingleNode(“/genre”); genre.Value = “NA”;}
D. foreach (XmlNode node in nodes){XmlNode genre = node.SelectSingleNode(“@genre”); genre.Value = “NA”;}
E. foreach (XmlNode node in nodes){XmlNode genre = node.SelectSingleNode(“genre”); genre.Value = “NA”;}

6.单项选择题You create a Web application to process XML documents. The Web application receives XML document files from several sources, reads them, and stores them in a Microsoft SQL Server database. The Web application parses all incoming data files to ensure that they conform to an XML schema. You need to find all validation errors in the XML document. What should you do?()

A. Load the XML data by using an instance of the XmlDocument class and specify a location for the application schema.
B. Configure the ValidationEventHandler in the XmlReaderSettings of the XmlReader object.
C. Read the XML file into a DataSet object and set the EnforceConstraints property to True.
D. Read the XML file into a DataSet object. Handle the DataSet.MergeFailed event to parse the data that does not conform to the XML schema.

7.多项选择题你使用拖放控件到 Visual Studio 2005 页面设计器的方式,给 ASP.NET Web 窗体增加了一个用户控件 MyControl。请问,Visual Studio 给你的 Web 窗体做了那些变化?()

A.为 Web 窗体的 body 增加了<control id="MyControl1" Runat="server" />元素。
B.为 Web 窗体增加了@ Register 标记。
C.为 Web 窗体的 body 增加了<uc1:MyControl id="MyControl1" Runat="server" /> 元素。
D.在 Web 窗体的节增加了<meta control="MyControl"> 元素。
E.为 Web 窗体增加了@ Control 标记。

8.多项选择题

请问在下图中使用了哪两个控件?()

A.Login
B.Login View
C.Login Status
D.Login Name
E.Password Recovery


10.多项选择题你需要在运行时通过程序引用一个用户控件,下面那些是可行的方案?()

A.在用户控件的@ Control 标记内包含ClassName 属性。
B.用户控件实现为单个Page,而不是code-behind。
C.ASP.NET Web 页实现为单个Page,而不是code-behind。
D.使用控件的ASP.NET Web 页包含一个@ Reference 标记。

最新试题

You create a Web site. You add an EditorZone control to the home page on the Web site. You need to enable users to customize the size and location of the Web Parts on their home pages.Which two controls should you add to the EditorZone control?()

题型:多项选择题

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?()

题型:多项选择题

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 create a large, n-tier Web application that has a custom event tracking system. You need to create a custom event type that enables your event tracking system to record all relevant event details for all types of events. The events must be stored in Microsoft SQL Server.From which base type should your custom event type inherit? ()

题型:单项选择题

You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults. You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form.Which code segment should you use?()

题型:单项选择题

You recently developed a Web application that accesses an external Web service to retrieve current exchange rates for Certkiller .com's e-Commerce Web site. The Web service converts USD prices to the customer's local currency. You have stored the URL to the external Web service's endpoint in the section of the Web.config file. The Web application has been successfully deployed to a Certkiller .com Web server named Certkiller -SR14. A few months later the vendor of the Web service changes the port that is used to access the Web service. You need to update the section of the Web application's Web.config file from Certkiller -WS528. You need to ensure that your solution has a minimal impact on customers that may be connected to the e-Commerce Web site.What should you do?()

题型:单项选择题

You create a Web site. The Web site has many predefined roles and associated users that will be used for security purposes. You need to manage these roles and user accounts.Which tool should you use? ()

题型:单项选择题

You create an intranet Web site for management of project documents. You need to enable all users to browse documents on the site. Only members of the administrators group must be ble to upload files.Which code segment of the Web.config file should you use?()

题型:单项选择题

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 are creating a Web application that will run on an intranet. The Web application reads comma-delimited text files. The text files reside in a subdirectory below the Web application's root directory. Users must not be able to navigate directly to these files in a Web browser unless they are members of the Accounting role. You need to write an ASP.NET HTTP handler that will use the FileAuthorizationModule class.Which form of authentication should you use?()

题型:单项选择题