最近读《ADO.NET 高级编程》,不甚明白。
书中,有很大篇幅是关于“建立强类型化的DataSet”(*.xsd),我想起以前看的几个例子,好像都没有用到这方面。
忽然想起微软的Duwamish7中继承自DataSet的common层,和上面的“强类型化的DataSet”是不是一回事啊??如果不是,有什么区别?
请哪位高手详细讲解,不胜感激。
谢谢。

解决方案 »

  1.   

    以我的理解,强类型应该是结构完整,类似于关系数据
    XSD文件是在VS.NET2003中建立数据集时自动产生的数据架构描述文件
      

  2.   

    强类型指的是较为独立完整的的数据集
    出了数据表外还包括类型、约束等,还可以作为基类派生相关的数据结构
    我看过一个例子,是生成派生的XML文件的
      

  3.   

    XSD应该对DATASET结构完整性约束作用吧.
    就像XSD约束XML一样!
      

  4.   

    xsd文件是数据架构,它的背后还有个同名的.cs类,这样你可以把一个表当一个对象来操作
      

  5.   

    这么说,微软的Duwamish7中继承自DataSet的common层,和上面的“强类型化的DataSet”不是一回事啊,duwamish7没用强类型,是吧?
      

  6.   

    期待有人把Duwanmish7的common层与“强类型”比较一下,说说各自的好处,以及为什么要这么做
      

  7.   

    当 xsd 当做对象 来应用 只需要将数据库的记录集 和 xsd 绑定起来
    操作
    重要的是 比如xsd 对象为 table 只能提示会提示出 所有的字段!!
    当然这些字段是你的xsd 那边设置好的!
      

  8.   

    XSD应该对DATASET结构完整性约束作用
      

  9.   

    Benefits of Using a Strongly Typed DataSet
    Another benefit of the DataSet is that it can be inherited to create a strongly typed DataSet. The benefits of a strongly typed DataSet include type checking at design time and the advantage of Microsoft® Visual Studio® .NET statement completion for your strongly typed DataSet. When you have fixed schema or relational structure for your DataSet, you can create a strongly typed DataSet that exposes rows and columns as properties of an object rather than items in a collection. For example, instead of exposing the name column of a row from a table of customers, you expose a Customer object's Name property. A typed DataSet derives from the DataSet class, so that you do not sacrifice any of the DataSet functionality. That is, a typed DataSet can still be remoted and can be supplied as the data source of a data-bound control such as a DataGrid. If schema is not known in advance, you can still benefit from the functionality of a generic DataSet, but you forfeit the additional features of a strongly typed DataSet.
    ====================================================================
    and HOW TO: Create and Use a Typed DataSet by Using Visual C# .NET
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/enu_kbwebdatanetkb/en-us/webdatanetkb/Q320714.htm#3
      

  10.   

    从机构体系上说,非类型化数据集是System.data.dataset对象的直接实例化,而类型化数据集是从System.data.dataset对象继承来的不同类。
    功能上,类型化数据集将表和表内的列作为对象属性而公开。可以直接通过他们的名称来引用表和列。
    而非类型化的数据集就需要分别通过Tables和Item集合来引用表和列。