IBM授权教育中心-顺时针软件开发学校论坛
IBM授权教育中心-哈尔滨顺时针软件开发学校
http://www.ibmssz.com
顺时针科技首页 论坛首页 搜索 用户列表 FAQ 注册 登录  
IBM授权教育中心-顺时针软件开发学校论坛 » 程序设计组 » C# » 08 微软认证考题
  08 微软认证考题
帖子发起人: 野野调皮   发起时间: 2008-06-24 09:48 上午   回复数: 0
« 上一主题
楼主
  2008-06-24, 09:48 上午
野野调皮 离线,最后访问时间: 2008-6-30 21:26:21 野野调皮



发帖数前25位
男

超级管理员
职务: 超级管理员
师长
等级: 师长
注册: 2007年4月12日
积分: 792
精华: 4
发贴: 645

本校学员

可以在本校学员论坛浏览及发贴
08 微软认证考题
 

1.您有一个名为myDataSet的强类型DataSet对象。该对象包含名为CategoriesProducts的两个DataTable对象。Categories有名为CategoryID的数据列。Products有名为CategoryIDProductID的两个数据列。CategoriesCategoryID有名为CategoryKey的主键。ProductsProductID有名为ProductKey的主键。您希望将一个外键约束添加到CategoriesProducts之间的CategoryID列。您应该使用哪个代码段?

A.  <xs:keyref name="CategoriesProducts" refer="CategoryKey">

      <xs:selector xpath=".//Products" />

      <xs:field xpath="CategoryID" />

    </xs:keyref>

B.  <xs:keyref name="CategoriesProducts" refer="ProductKey">

      <xs:selector xpath=".//Products" />

      <xs:field xpath="CategoryID" />

    </xs:keyref>

C.  <xs:keyref name="CategoriesProducts" refer="CategoryKey">

      <xs:selector xpath=".//Products" />

      <xs:field xpath="ProductID" />

    </xs:keyref>

D.  <xs:keyref name="CategoriesProducts" refer="ProductKey">

      <xs:selector xpath=".//Categories" />

      <xs:field xpath="CategoryID" />

    </xs:keyref>

2.您有一个名为 productsDataReader SqlDataReader 对象。该 productsDataReader 对象包含按以下顺序的三个列:

"整数"类型的ProductID

nvarchar (40) 类型的 ProductName

"整数"类型的 UnitsInStock

您希望用productsDataReader来创建一份库存管理报告。您定义了以下三个变量:

"整数" 类型的 myProductID

"字符串" 类型的 myProductName

"整数" 类型的 myUnits

您需要确保报告尽快地运行。您因该使用哪个代码段?

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("myproductName")

    myUnits = productsDataReader.Item("UnitsInStock")

D.  myProductID = productsDataReader.GetName("ProductID")

    myproductName = productsDataReader.GetName("myproductName")

myUnits = productsDataReader.GetName("UnitsInStock")

没有正确答案,最接近的是D,正确答案如下:

myProductID = productsDataReader.GetName(0)

    myproductName = productsDataReader.GetName(1)

myUnits = productsDataReader.GetName(2)

 

 

3.您正计划创建名为 myDataSet DataSet 对象,以用于一个债卷交易应用程序。

几位开发人员需要编写操作 myDataSet 的代码,而您希望确保 myDataSet 易于

他们使用。您决定将 myDataSet 创建为强类型数据集。您应该采取哪两种措施?(每个正确答案都给出了部门解决方案。请选择两个答案。)

A. 创建一个定义 myDataSet XSD架构。

B. 创建一个定义 myDataSet XDR架构。

C. 针对 myDataSet, 创建一个基于该架构并从 DataSet类继承的类。

D. 针对 myDataSet, 创建一个基于该架构并从 XmlSchema 类继承的类。

E. 使用"强名称"工具(Sn.exe,myDataSet创建一个密钥对。

 

4.您的 Microsoft SQL Server 数据库包含名为 Regions 的表。Regions 包含一个销售跟踪应用程序的所有销售地区。您使用名为 myDataAdapter SqlDataAdapter 对象,创建了名为 refionsDataSet DataSet 对象。该对象使用一个单一 SQL SELECT 语句来填充该 regionsDataSet. 您将 regionsDataSet 绑定到名为 regionsDataGrid DataGrid 对象,以显示Regions的内容。现在,您希望使用相同的 regionsDataSet,myDataAdapter regionsDataGrid,来插入,更新和删除 Regions中的数据。您希望编写最少的代码来完成此任务。您该怎么办?

A.  实例化 sqlCommandBuilder  对象。该对象将 myDataAdapter 作为构造函数参数。将一个 Update 按钮添加到该窗体,并用myDataAdapter将更新 regionsDataSet 的代码添加到 Click事件。

B.  实例化 sqlCommandBuilder  对象。该对象将 myDataAdapter 作为构造函数参数。为每个插入,更新和删除函数创建存储过程,并将该存储过程与 myDataAdapter InsertCommand,UpdateCommand DeleteCommand 属性相关联。将一个Update按钮添加到该窗体,并用MyDataAdapter将更新 regionsDataSet 的代码添加到Click事件。

C.  为每个插入,更新和删除函数创建存储过程,并将该存储过程与 myDataAdapter InsertCommand,UpdateCommandDeleteCommand属性相关联。将一个Update按钮添加到该窗体,并用myDataAdapter将更新 regionsDataSet的代码添加到Click事件。

D.  为每个插入,更新和删除函数创建SQL字符串,并将该SQL字符串与myDataAdapterInsertCommand,UpdataCommandDeleteCommand属性相关联。将一个Update按钮添加到该窗体,并用 myDataAdapter将更新 regionsDataSet的代码添加到Click事件。

 

5.您的Microsoft SQL Server数据库包含名为 Customers 的表。Customers包含名为 FamilyName,personalNameAddress的三个列。您实例化了名为myCommand SqlCommand对象;您将用该对象来填充名为 customersDataReader DataReader对象。您需要将myCommand初始化成加载 customersDataReader,以包括Customers中所有行的FamilyNamepersonalName

您应该使用哪个代码段?

A.  myCommand.CommandText="SELECT FamilyName, "_

      & "PersonalName FROM Customers"

B.  myCommand.CommandType="SELECT FamilyName, "_

      &"PersonalName FROM Customers"

C.  myCommand.Parameters.Add{"SELECT FamilyName, "_

      &"PersonalName FROM Customers"}

D.  myCommand.ExecuteNonQuery()

 

6.您正在创建名为DistributionServiceXML Web服务。此项服务必须能够访问和操作

SQL Server 数据库中名为 Inventory 表中的数据。DistributionService中的一些函数需要将库存数据公开为XML数据。DistributionService中的其它函数需要将库存数据公开为DataSet对象。您需要创建提供此数据访问数据的对象。您应该使用哪个对象?

A. XmlDo***ent

B. XmlDo***entFragment

C. XPathDo***ent

D. XmlDataDo***ent

 

7.您有一个名为 ordersDataReaderSqlDataReader对象。该对象包含名为 OrderQuantity,并采用整数值形式的列。该对象还包含一个对应前一周接收到的一笔订单的行。您需要编写代码,以处理 ordersDataReader中的每行,并将OrderQuantity传递名为myFunction的函数。

您应该使用哪个代码段?

A. While ordersDataReader.Read

    Call myFunction(ordersDataReader("OrderQuantity"))

   End While

B. While ordersDataReader.NextResult

    Call myFunction(ordersDataReader("OrderQuantity"))

   End While

C. Dim orderCount as Integer

   While orderCount < ordersDataReader.FieldCount

     Call myFunction(ordersDataReader("orderQuantity"))

     orderCount +=1

     ordersDataReader.Read

     End While

D.   Dim orderCount as Integer

     While orderCount < ordersDataReader.FieldCount

       Call myFunction(ordersDataReader("OrderQuantity"))

       orderCount +=1

       ordersDataReader.NextResult

    End While

8.您正在解决以前的同事所开发 Visual Studio.NET应用程序的问题。该应用程序包含一个

NextToken函数。该函数从一个文件读取产品名称。您在一个大型程序集中发现以下代码段:

Dim xwriter As XmlTextWriter("productNames.xml",_

  System.Text.Encoding.UTF8)

xwriter.WriteStartDo***ent(True)

xwriter.WriteStartElement("data","www.contoso.com")

Dim val As String = NextToken()

While val <> ""

  xwriter.WriteElementString("item",_

    "www.contoso.com",val)

  val=NextToken()

End While

xwriter.WriteEndElement()

xwriter.WriteEndDo***ent()

xwtirer.Close()

 

您发现productNames.xml仅包含两个项:prod0prod1.该代码段将产生哪项XML输出?

A. <?xml version="1.0"?>

   <data xmlns="www.contoso,com">

     <item = "prod0" />

     <item = "prod1" />

   </data>

B. <?xml version="1.0" encoding="utf-8" standalone="yes"?>

   <data>

     <item xmlns="www.contoso.com">prod0</item>

     <item xmlns="www.contoso.com">prod1</item>

   </data>

C. <?xml version="1.0"?>

   <data>

     <item>prod0</item>

     <item>prod1</item>

   </data>

D. <?xml version="1.0" encoding="utf-8" standalone="yes"?>

   <data xmlns="www.contoso.com">

     <item>prod0</item>

     <item>prod1</item>

   </data>

9.您正在开发订单处理应用程序,以检索 Microsoft SQL Server 数据库中的数据。该数据库包含名为 Customers 的表和名为Orders的表。Customers有一个 CustomerID主键。Orders中的每一个CustomerID,表示哪位可户下了订单。您的应用程序使用名为 OrdersDataSet DataSet 对象,在起应用与该数据库之前,捕获客户和订单信息。OrdersDataSet对象有名为

CustomersOrders的两个DataTable对象。您希望确保,如果 Customers DataTable 对象中不存在相匹配的行,那么该行也不回出现在Orders DataTable对象中。

您应该采取哪两项措施?(每个正确答案都给出了部分解决方案。请选择两个答案)

A. 创建名为ConstraintOrders的外键约束,使Orders.CustomerID成为其父列,是Customers.CustomerID成为其子列。

B. 创建名为ConstraintCustomers的外键约束,使Customers.CustomerID 成为其父列,使Orders.CustomerID成为其子列。

C. 创建Customers.CustomerID创建名为 UniqueCustomers的唯一约束。

D. ConstraintOrders添加到Orders DataTable

E. ConstraintOrders添加到Customers DataTable

F. ConstraintCustomers添加到 Orders DataTable

G. ConstraintCustomers添加到 Customers DataTable

H. UniqueCustomers添加到 Customers DataTable

10.您创建了名为custo***ataSet 的强类型 DataSet对象。该对象包含名为Customers的单一DataTable对象。Customers有一个名为 CustomerID 列。该列包含针对 Customers中每一行的一个唯一标识符。您希望将一个主键添加到Customers.您应该使用哪个代码段?

A. <xs:key name="CustomerKey" msdata:PrimaryKey="true">

     <xs:selector xpath=".//Customers" />

     <xs:field xpath="CustomerID" />

   </xs:key>

B. <xs:element name="CustomerID" type="xs:string" msdata:PrimaryKey="true"/>

C. <xs.key name="CustomerKey">

     <xs:selector xpath=".//Customers" />

     <xs:field xpath="CustomerID" />

   </xs:key>

D. <xs:unique name="CustomerKey">

     <xs:selector xpath="Customers" />

     <xs:field xpath="CustomerID" />

   </xs:unique>

11.您的Microsoft SQL Server数据库有一个计算每天接受到的订单总数的存储过程。该存储过程返回的结果是整数型单一数据值。您需要编写代码,以执行该存储过程,并以一个整数值形式返回结果。您实例化了名为 myCommand SqlCommand对象,并初始化所有相应的您应该使用哪个 myCommand 方法?

A.  ExectueReader

B.  RxecuteNonQuery

C.  ExecuteScalar

D.  ExecuteXMLReader

12.您正在开发一个应用程序。该应用程序将加载来自一个 Microsoft SQL Server 数据库的两个DataReader 对象。这两个 DataReader对象分别名为customersDataReaderproductsDataReader.customersDataReader对象从Customers表加载。ProductsDataReader对象从Products 表加载。您创建名为myCommand SqlCommand对象和名为myConnectionSqlConnection对象。您编写以下代码段。(所包括的行号仅供参考)

01 myCommand.Connection=myConnection

02 Dim customersDataReader As SqlDataReader

03 Dim productsDataReader As SqlDataReader

04 myCommand.CommandText="SELECT * FROM Customers"

05 myConnection.Open()

06 customersDataReader=myCommand.ExecuteReader

07   ' Code to process the data reader goes here.

08   ' Insert new code

09 myCommand.CommandText="SELECT * FROM Products"

10 productsDataReader=myCommand.ExecuteReader

11   ' Code to process the data reader goes here.

您运行该应用程序,第10行产生了一个异常。为纠正此问题,您需要在08行插入附加代码。

您应该使用哪个代码段?

A.  myCommand.ResetCommandTimeout()

B.  myCommand.Dispose()

C.  customersDataReader.NextResult()

D.  customersDataReader.Close()

13.您正在创建名为EmployeeLocations的服务组件。该组件将返回一个特定城市中当前员工的列表。员工位置列表每晚变化。EmployeeLocations 必须每晚加载名为Emploc.xmlXML文件。EmployeeLocations包含名为EmployeesInCity的方法。EmployeesInCity采用一个字符串城市代码,并返回一个 Employee对象阵列。EmployeeLocations将使用XML数据来返回某个城市全天的员工列表。EmployeeLocations必须尽快地响应EmployeesInCity方法调用。

您该怎么办?

A. 每晚,将Emploc.xml加载入一个 MemoryStream对象。针对每个请求,用一个XmlTextReader来找到被请求的城市,然后找到该城市中的员工。

B. 每晚,将Emploc.xml加载如一个XPathDo***ent对象。针对每个请求,用XPathNavigator.Select方法创建一个XPathNodeIterator对象。用该XPathNOdeIterator对象返回员工列表。

C. 每晚,将Emploc.xml加载入一个XmlDo***ent对象。针对每个请求,用XmlDo***ent.GetElementsByTagName 方法创建一个将包含响应员工列表的XmlNodeList对象。