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

You have a SqlDataReader object named ProductsDataReader. The ProductsDataReader object contains three columns in the following order:ProductID as Integer ProductName as nvarchar (40)UnitsInStock as IntegerYou want to use ProductsDataReader to create an inventory management report. You define the following three variables:MyProductID as Integer MyProductName as String MyUnits as IntegerYou need to ensure that the report runs as quickly as possible.Which code segment should you use?

发布时间:2021-12-25

A.MyProductID - ProductsDataReader.Item(1)MyProductName ** ProductsDataReader.Item(2}MyUnits * ProductsDataReader.Item(3)

B.MyProductID - ProductsDataReader.Item(0).MyProductName * ProductsDataReader.Item(1)MyUnits - ProductsDataReader.Item(2)

C.MyProductID = ProductsDataReader.Item("ProductID") MyProductName « ProductsDataReader. Item (" ProductName1*) MyUnits - ProductsDataReader.Item("UnitsInStock")

D.MyProductID * ProductsDataReader.GetOrdinal("ProductlD") MyProductName - ProductsDataReader. GetOrdinal ("ProductName") MyUnits « ProductsDataReader.GetOrdinal《"UnitsInStock*1)

试卷相关题目

  • 1You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceOrder, which is shown in the following code segment:<WebMethod(TransactionOption.RequiresNew)>Public Function PlaceOrder(orderData As DataSet) As DataSet Dim brakes As New Serverl.BrakesService ()Dim parts As New Server2.PartsService()'Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderDat

    A.Tables(Brakes))'Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables(Parts))End FunctionBrakesService and PartsService are XML services. The Transac- tionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required.You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.What is the most likely result?A.OrderParts stops processing the order, and all orders are cancelled

    B.OrderParts continues processing the order, and all orders are placed

    C.OrderParts stops processing the order, the brakes are ordered, but the wheels are not ordered

    D.You develop a Windows Forms application named PartOrderApp that consumes AutoPartsServic

    E.You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.What is the most likely result?A.OrderParts stops processing the order, and all orders are cancelledB.OrderParts continues processing the order, and all orders are placedC.OrderParts stops processing the order, the brakes are ordered, but the wheels are not orderedD.OrderParts stops processing the order, the brakes are not ordered, but the wheels are ordered

    开始考试点击查看答案
  • 2Your company frequently receives product information from external vendors in the form of XML dat

    A.You receive XML document files, an .xdr schema file, and an xsd schema file.You need to write code that will create a typed DataSet object on the basis of product information. Your code will be used in several Visual studio .NET applications to speed up data processing.You need to create this code as quickly as possible.What should you do?A.Create the code manually

    B.Use XmlSerializer.Serialize to generate the code

    C.Use XmlSerializer.Deserialize to generate the code

    D.Use the Xml Schema Definition tool (Xsd.exe) to generate the code

    开始考试点击查看答案
  • 3You are creating an XML Web service that will be accessed by callers who cannot use SSL encryption because if firewall restrictions. To protect sensitive data, you want to encrypt a portion of the data returned from the service by using objects in the Cryptography namespace.The service will use a standard encryption routine to encrypt the data before it is sent to the caller. The caller will decrypt the data by using instructions provided by you.You need to write code to encrypt the sensitive data that is in a local variable named myDat

    A.First, you create an instance of a Cryptography Service Provider.What should you do next?A.Create an Encryptor object that passes in a key and an initialization vector (IV) as parameters . Call the GetHashCode method of the Encryptor object to generate a new hash code. Convert the generated hash code to a stream and use the CryptoStream object to write the value of the hash code to an encrypted stream. Convert the output stream to a string

    B.Create a UnicodeEncoding object and use it to encode the valueof myData into a byte array. Use the ComputeHash method of the Cryptography Service Provider to create a hash from the encoded byte array. Convert the output of Compute Hash from a byte array to a string

    C.Create a UnicodeEncoding object and use it to encode the value of myData into a byte array. Use the GetHashCode method of the Cryptography Service Provider to create a hash from the encoded byte array. Convert the output of GetHashCode from a byte array to a string

    D.Create an Encryptor object that passes in a key and an initialization vector(IV) as parameters. Create a Cryp- toStream object that passes in an output stream and the Encryptor object as parameters. Convert myData to a stream and use the CryptoStream object to write the value of myData to an encrypted stream. Convert the output stream to a string

    开始考试点击查看答案
  • 4Your Microsoft SQL Server database has a stored procedure named GetCompanyName which accepts one parameter named @CustomerID and returns the appropriate company name.You instantiate a SqlCommand object named STCommand. You need to initialize STCommand to return the company name for @CustomerID with a value of "ALFKI".Which code segment should you use?

    A.STCommand.CommandText = "GetCompanyName, ALFKI") STCommand.Parameters.Add("@CustomerID")

    B.STCommand.CommandText = "GetCompanyName"STCommand.Parameters.Add("GetCompanyName", "ALFKI")C . STCommand.CommandText = "@CustomerID"STCommand.Parameters.Add("GetCompanyName", "ALFKI")D. STCommand.CommandText = "GetCompanyName"STCommand.Parameters.Add("@CustomerID", "ALFKI”)

    开始考试点击查看答案
  • 5Your Microsoft SQL Server database BackOrders contains a table that consists of more than 1 million rows. You need to develop an application that reads each row in the table and writes the data to a flat file. The application will run only once each day.You want the application to process the data as quickly as possible.Which class should you use to retrieve the data?

    A.DataSet

    B.DataTable

    C.DataReader

    D.DataAdapter

    开始考试点击查看答案
  • 6You are developing an application that queries a Microsoft SQL Server database. The application will package the results of the query as XML dat

    A.The XML data will be retrieved directly from the database and transmitted electronically to a business partner.The query must retrieve all rows and all columns from a database table named Customers.Which query should you use?A.SELECT * FROM Customers FOR XML AUTO

    B.SELECT * FROM XML FROM Customers

    C.SELECT * FROM Customers as XMLDATA

    D.SELECT * FROM OPENXML('开始考试点击查看答案

  • 7You have a DataSet object named YourDataSet. This object contains two DataTable objects named Customers and Orders. Customers has a column named CustomerlD, which is unique to each customer. Orders also has a column named CustomerlD.You want to use the GetChildRows method of the DataRow object to get all orders for the current customers.What should you do?

    A.Add a foreign key constraint on CustomerlD of Orders between Customers and Orders

    B.Add a data relation to YourDataSet on OrderlD between Customers and Orders

    C.Create a unique constraint on CustomerlD of Customers

    D.Create a primary key on CustomerlD of Customers

    开始考试点击查看答案
  • 8You have DataSet object named LoanCustomersDataSet that contains customers serviced by the loan department of your company. You receive a second DataSet that contains customers serviced by the asset management department of your company. Both objects have the same structure.You want to merge assetCustomersDataSet into LoancustomersDataSet and preserve the original values in loanCustomerDataSet.Which code segment should you use?

    A.loancustomersDataSet.Merge(assetCustomersDataSet)

    B.loancustomersDataSet.Merge(assetCustomersDataSet, True)

    C.assetCustomersDataSet.Merge(loancustomersDataSet)

    D.assetCustomersDataSet.Merge(1oanCustomersDataSet, True)

    开始考试点击查看答案
  • 9As a software developer at your company, you are creating an XML Web service named DistributionService. This service must be able to access and manipulate data in a table named Inventory in a Microsoft SQL Server database.Some functions within Distribution Service need the inventory data to be exposed as XML data . Other functions within DistributionService need the inventory data to be exposed as a DataSet object.You need to create the object that will provide this data access.Which object should you use?

    A.XmlDocument

    B.XmlDocumentFragment

    C.XPathDocument

    D.XmlDataDocument

    开始考试点击查看答案
  • 10You develop an ADO.NET application that uses a Microsoft SQL Server database and a SqlClient data provider. Your application includes the following four code segments, which are each called once:Dim MyConnection 1 As New SqlConnection () MyConnectionl.Connectionstring = "Data Source=" & "ProdServer;Initial Catalog=Billing/& "Integrated Security=true"MyConnectionl.Open ()Dim MyConnection2 As New SqlConnection() MyConnection2.Connectionstring = "DataSource=" & "ProdServer;Initial Catalog=Billing;& "Integrated Security=true"MyConnection2.Open ()Dim MyConnection3 As New SqlConnection() MyConnection3.Connectionstring = "Data Source=" & "SearchServer;Initial Catalog=Search;& "Integrated Security=true"MyConnection3.Open()Dim MyConnectionl As New SqlConnection() MyConnectionl.Connectionstring ="Data Source=" & "ProdServer;Initial Catalog=OrderEntry;"& "Integrated Security=true"MyConnection4.Open()You verify that your application is the only application that is using SQL Server. Your application runs all code segments by using the same identity.You run the application. Connection pooling is enabled, and the entire application run within the connection timeout parameter.How many connection pools are created?

    A.One

    B.Two

    C.Three

    D.Four

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