天龙八部3d明教攻略:求助ADO.NET和C#高手3

来源:百度文库 编辑:高考问答 时间:2024/04/30 00:00:02
46、在SQL Server数据库中有一个名为GetCustomer的存储过程。当GetCustomer接收到@CustomerID参数时,就返回相应的公司名称。你实例化一个名为myCommand的SqlCommand对象,你需要初始化myCommand,使@CustomerID对应的公司名为“GOODPET”,你该使用哪段代码?
A.myCommand.CommandText = “GetCustomer, GOODPET”
myCommand.Parameters.Add (“@CustomerID”)
B.myCommand.CommandText = “GetCustomer”
myCommand.Parameters.Add (“Customer”, “GOODPET”)
C.myCommand.CommandText = “@CustomerID”
myCommand.Parameters.Add (“GetCustomer”, “GOODPET”)
D.myCommand.CommandText = “GetCustomerr”
myCommand.Parameters.Add (“@CustomerID”, “GOODPET”)
47、你创建了一个名为ProductsDataset的DataSet对象,它包含了一个SQL Server数据库的产品信息。这个对象的ProductID列是主键,你想创建一个新的DataSet对象,使其具有与ProductsDataset相同的结构,包括相同的主键,这个新的DataSet对象中没有数据,你该使用哪段代码?
A.DataSet NewDataSet = ProductsDataset.Clone
B.DataSet NewDataSet = ProductsDataset.Copy
C.DataSet NewDataSet =new DataSet ( )
newDataSet.Tables.Add (“ProductsDataset”)
D.DataSet NewDataSet =new DataSet ( )
newDataSet.Tables.Add (ProductsDataset.Tables (0))
48、你有个名为customersDataSet 的DataSet 对象,此对象包含一个名为Customers 的DataTable 对象,Customers 从SQL Server 数据库中检索信息。Customers 包含一个名为Region 的列。你想创建一个名为customersDataView 的DataView 对象,此对象仅包含了所有Region 值为France 的客户。你该采用哪个代码段?
A.DataView customersDataView =new DataView(customersDataSet.Tables(“Customers”))
customersDataView.FindRows(“Region = France”)
B.DataView customersDataView =new__DataView(customersDataSet.Tables(“Customers”))
customersDataView.FindRows(“Region =’France’”)
C.DataView customersDataView =new__DataView(customersDataSet.Tables(“Customers”))
customersDataView.RowFilter = (“Region = France”)
D.DataView customersDataView =new__DataView(customersDataSet.Tables(“Customers”))
customersDataView.RowFilter = (“Region = ‘France’”)
49、有一个名为CustomersDataSet的强类型DataSet对象,该对象包含了一个单一的名为CompanyCustomers的DataTable对象。CompanyCustomers有一个名为CustomerID的整型列。你想通过由CustomersDataSet提供的类型安全编码规范,来访问CustomerID值。你要给一个CustomerID字符变量赋值,你应选用哪一段代码?
A. customerID = customersDataSet.TestKCustomers(0).CustomerID.ToString()
B. customerID =customersDataSet.TestKCustomers.Columns(“CustomerID”).ToString()
C. CustomerID =customersDataSet.Tables(“TestKCustomers”).Columns(“CustomerID”).ToString()
D. customerID =customersDataSet.Tables(“TestKCustomers”).Rows(0)(“CustomersID”).ToString()
50、你的BackOrders 库包含了一个一百多万行的表。你需要开发一个应用程序来读取表中的每一行,把表中数据导到一个文本文件中。应用程序每天只运行一次。你希望应用程序能尽可能快的处理数据,你该使用哪个类来检索数据?

A.DataSet
B.DataTable
C.DataReader
D.DataAdapter

D
A
D
D
C