位置:首页 > 题库频道 > 其它分类 > 计算机其它 > 微软MCAD 70-310 实战百题

You need to write the c<ide that will parse the document and build the customerOutput string that will be used to write each row in the file.Which code segment should you use?

发布时间:2021-12-25

A.Dim myNodeList As XmlNodeListmyRootNode.SelectNodes[/CustomerData/Customers)For Each curNode In myNodeList If curNode.HasChildNodes Then customerOutput -""For i « 0 To curNode.ChildNodes.Count - 1 customerOutput = curNode.ChildNodes(D.Name &一 »*=•,+curNode.ChildNodes(D.InnerText 'Code to write the output files goes here.Next i End If Next

B.Dim myNodeList As XmlNodeList = _ myRootNode.SelectNodes(/CustomerData/Customers)For Each curNode In myNodeListIf curNode.HasChildNodes Then customerOutput * ”"For i = 0 To curNode.ChildNodes.Count - 1 customerOutput * curNode.ChildNodes(D.Name &_ +curNode.ChildNodes(D.Value •Code to write the output file goes here.Next i End If Next

C.Dim myNodeList As XmlNodeList * myRootNode.SelectNodes (/Customers)For Each curNode In myNodeList If curNode.HasChildNodes Then customerOutput = ,M,For i = 0 To curNode.ChildNodes.Count - 1 customerOutput = curNode.ChildNodes (i) .Name &_"="+ curNode.ChildNodes(

D.Name &一 »*=•,+curNod

E.ChildNodes(D.InnerText 'Code to write the output files goes here.Next i End If NextB.Dim myNodeList As XmlNodeList = _ myRootNode.SelectNodes(/CustomerData/Customers)For Each curNode In myNodeListIf curNode.HasChildNodes Then customerOutput * ”"For i = 0 To curNode.ChildNodes.Count - 1 customerOutput * curNode.ChildNodes(D.Name &_ +curNode.ChildNodes(D.Value •Code to write the output file goes here.Next i End If NextC.Dim myNodeList As XmlNodeList * myRootNode.SelectNodes (/Customers)For Each curNode In myNodeList If curNode.HasChildNodes Then customerOutput = ,M,For i = 0 To curNode.ChildNodes.Count - 1 customerOutput = curNode.ChildNodes (i) .Name &_"="+ curNode.ChildNodes(D.InnerText 'Code to Write the output file goes here. .Next i End If NextD.Dim myNodeList As XmlNodeList = myRootNode.SelectNodes ("/Customers")For Each curNode In myNodeList If curNode.HasChildNodes Then customerOutput =""For i = 0 To curNode.ChildNodes.Count - 1customerOutput =_ curNode.ChildNodes(D.Attributes(0).value + ='&_ curNode.ChildNodes(i) .Attributes (1) .Value 'Code to write the output file goes here.Next i End If Next

试卷相关题目

  • 1Your Microsoft SQL Server database has a stored procedure that sums the total number of orders received each day. The stored procedure returns a result that is a single data value of type integer.You need to write code that will execute the stored procedure and return the result as an integer value.You instantiate a SglCommand object named myCommand and initialize all appropriate parameters.Which myCommand method should you use?

    A.ExecuteReader

    B.ExecuteNonOuery

    C.ExecuteScalar

    D.ExecuteXMLReader

    开始考试点击查看答案
  • 2You have a DataSet object named ordersDataSet. This object contains two DataTable objects named Orders and OrderDetails. Both Orders and OrderDetails contain a column named OrderlD.You create a DataRelation object named orderRelation between Orders and OrderDetails on OrderlD. Order is the parent table. OrderDetails is the child table.You add orderRelation to the ordersDataSet relation collection by using the following of code:ordersDataSet.Relations.Add(orderRelation)You verify that prior to adding orderRelation, there were no constraints on either table You then run the line of code.How many constraints does each table have now?

    A.One on Orders; none on OrderDetails

    B.None on Orders; one on OrderDetails

    C.None on Orders; none on OrderDetails

    D.One on Orders; one on OrderDetails

    开始考试点击查看答案
  • 3Your Microsoft SQL Server database contains a table named Orders. Due to a recent increase in product sales, Orders now contains more than 500,000 rows.You need to develop an application to produce a report of all orders in the table. You need to ensure that the application processes the data as quickly as possible.Which code segment should you use?

    A.Dim myOleDbConnection As New OleDbConnection _ ("Data Source=(local)/& "Initial Catalog=Northwind;& "Integrated Security=true")Dim myOleDbCommand As New 01eDbCommand_("SELECT * FROM Orders" , myOleDbConnection)Dim ordersDataReader As OleDbDataReader MyOleDbConnection.Open ()OrdersDataReader = myOleDbcorrunand. Execut eReader

    B.Dim myOleDbConnection As New OleDbConnection _("provider=sqloleDb;Data Source= (local);& "Initial Catalog=Northwind/" _& "Integrated Security=true")Dim myOleDbCommand As New 01eDbCommand_("SELECT * FROM Orders" , myOleDbConnection)Dim ordersDataReader As OleDbDataReader myOleDbConnection.Open()ordersDataReader = myOleDbCommand.ExecuteReader

    C.Dim myConnection As New SqlConnection("Data Source= (local);Initial Catalog=Northwind;" & "Integrated Security=true")Dim myConur.and as new SqlCommand_("SELECT * FROM Orders" , myConnection)Dim ordersDataReader As SqlDataReader Myconnection.Open()OrdersDataReader = mycomman

    D.ExecuteReaderD.Dim myConnection As New SqlConnection __("Data Source= (local); Initial Catalog=Northwind;" _& "Integrated Security=true")Dim myCorrjr.and as New SqlCommand ("SELECT * FROM Orders") Dim ordersDataReader As SqlDataReader Myconnection.Open()ordersDataReader = myCommand.ExecuteReader

    开始考试点击查看答案
  • 4You are developing an application that retrieves a list of geographical regions from a table in a Microsoft SQL Server database. The list of regions is displayed in a dropdown list box on a Windows Form. .You want to populate the list box with data from a DataSet object. You want to fill the DataSet object by using a SqlDataAdapter object.You create a SqlConnection object named YourConnection and a SQL query string named regionSQL. You need to write the code to create the SqlDataAdapter object.Which code segment should you use?

    A.Dim myDataAdapter As New SqlDataAdapter()myDataAdapter.SelectCommand.Connection = MyConnection myDataAdapter.SelectCommand.CommandTexc = regionSQL

    B.Dim myDataAdapter As New SqlDataAdapter(regionSQL, MyConnection)C . Dim SqlCmd As New SqlCommand(regionSQL)Dim myDataAdapter As New SqlDataAdapter() myDataAdapter.SelectCommand.Connection = MyConnection myDataAdapter.SelectCommand = SqlCmdD. Dim SqlCmd As New SqlComrnand ()Dim myDataAdapter As New SqlDataAdapter()SqlCmd.CommandText = regionSQLmyDataAdapter.SelectCommand.Connection = MyConnection myDataAdapter.SelectCommand = SqlCmd

    开始考试点击查看答案
  • 5You are planning to create a DataSet object named YourDataSet to be used in a bond-trading application. Several developers will need to write code to manipulate YourDataSet, and you want to ensure that YourDataSet is easy for them to use . You decide to create YourDataSet as a strongly typed data set.Which two actions should you take? (Each correct answer presents part of the solution. Choose two)

    A.Create an XSD schema that defines YourDataSet

    B.Create an XDR schema that defines YourDataSet

    C.Create a class for YourDataSet that is based on the schema and that inherits from the DataSet class

    D.Create a class for YourDataSet that is based on the schema and that inherits from the XmlSchema class

    E.Create a key pair for YourDataSet by using the Strong Name tool(Sn.exe)

    开始考试点击查看答案
  • 6You are troubleshooting a Visual Studio .NET application that was developed by a former colleague. The application contains a NextToken function. This function reads product names from a file. You find the following code segment with a large assembly(Line numbers are included for reference only):1 Dim xwriter As New XmlTextWriter("productNames.xml",2System.Text.Encoding.UTF8)3xwriter.WriteStartDocument(True)4xwriter.WriteStartElement("data", nwww.contozo.com")5Dim val As String * NextToken()6While val <> ""7xwriter.WriteElementString("item",_8"www.contozo.com", val)9val = NextToken()10xwriter.WriteEndElement()11xwriter.WriteEndDocument()12xwriter.Close()You find that productsNames.xml contains only two entries: prodO and prodl.Which XML output is produced by this code segment?

    A.

    B. prod0prodl

    C. prod0prodl

    D. prod0prodl

    开始考试点击查看答案
  • 7You create a Windows service named myService that queries a table named Orders in a Microsoft SQL Server database. You want myService to check every 30 seconds for now rows in Orders.You create the following method in myService:Private Sub ProcessOrders(ByVal source As Object, ByVal event- arguments As Timers.ElapsedEventArgs)'Logic to process Orders table goes here.End SubYou need to add additional code to myService to invoke the ProcessOrders method.What should you do?

    A.To the OnStart method, add the following code segment:Dim myTimer As New Timers.Timer()AddHandler myTimer.Elapsed, AddressOfProcessOrders myTimer.Interval = 30000 myTimer.Enabled = True

    B.To the OnCustomCommand method, add the following code segment: Dim myTimer As New Timers.Timer ()AddHandler myTimer.Elapsed, AddressOf ProcessOrders myTimer.Interval = 30000 myTimer.Enabled = True

    C.To the OnStart method, add the following code segment: Dim myTimer As New Timers.Timer ()AddHandler myTimer.Elapsed, AddressOf ProcessOrders myTimer.Interval = 30000 myTimer.AutoReset = True

    D.To the OnCustomCommand method, add the following code segment: Dim myTimer As New Timers.Timer ()AddHandler myTimer.Elapsed, AddressOf ProcessOrders myTimer.Interval = 30000 myTimer.AutoReset = True

    开始考试点击查看答案
  • 8You create a class named User that provides user information from a variety of data sources. Different instances of User connect to different data sources to load the dat

    A.User is a read-only representation of user information and does not support written changes back to a data source.The User class includes the following code segment: Public Class UserPublic Sub New(String connectionstring)Me.connectionstring =* connectionstring 'Additional construction code goes here.End SubFriend Readonly Property ConnectionString() As String GetReturn connectionstringEnd GetEnd PropertyPrivate connectionstring As String 'Other methods and properties go here.End ClassOnce a User object has been populated, it no longer needs the connectionstring member variable.You have a .NET Remoting object named Project that returns User objects. You want to prevent remote client applications from being able to view the content of the connectionstring member variable.What should you do?A.Make the Connectionstring property private

    B.Remove the connectionstring parameter from the constructor

    C.Add the NonSerialized attribute to the Connectionstring property

    D.Add the NonSerialized attribute to the connectionstring member variable

    开始考试点击查看答案
  • 9You develop an application named myApp. This application needs to run on the same computer as a Windows service named myService.You want to ensure that myService starts from myApp if myService is not already running.Which code segment should you use?

    A.Dim myServiceController As New ServiceController("myService")If myServiceController.Status = _ServiceControllerStatus.Stopped Then myServiceController.Start()End If

    B.Dim myServiceController As New _ServiceController("myService") myServiceController.Start ()C . Dim myArgs(1) As StringmyArgs(0)="myService"Dim myServiceController As New _ServiceController ()If myServiceController.Status = ServiceControllerStatus. Stopped _Then myServiceController.Start(myArgs)End IfD. Dim myArgs(0) As String myArgs(0)= "myService"Dim myServiceController As New _ServiceController ()myServiceController . Start (rnyArgs)

    开始考试点击查看答案
  • 10You have a strongly typed object named myDataSet. This objectcontains two DataTable objects named Categories and Products.Categories has a data column named CategoryID. Products has two datacolumns named CategoryID and ProductID.Categories has a primary key named CategoryKey on CategoryID.Products has a primary key named ProductKey on ProductID.You want to add a foreign key constraint on CategoryID column betweenCategories and Products.Which code segment should you use?

    A.

    B.

    C.

    D.

    开始考试点击查看答案
返回顶部