数据集、数据表和数据视图DataSets, DataTables, and DataViews

ADO.NET DataSet 是数据的一种内存驻留表示形式,无论它包含的数据来自什么数据源,都会提供一致的关系编程模型。The ADO.NET DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the source of the data it contains. DataSet 表示整个数据集,其中包含对数据进行包含、排序和约束的表以及表间的关系。A DataSet represents a complete set of data including the tables that contain, order, and constrain the data, as well as the relationships between the tables.

使用 DataSet 的方法有若干种,这些方法可以单独应用,也可以结合应用。There are several ways of working with a DataSet, which can be applied independently or in combination. 你可以:You can:

强类型化的 DataSet 也可以使用 XML Web services 来进行传输。A strongly typed DataSet can also be transported using an XML Web service. DataSet 的设计使其成为使用 XML Web services 传输数据的理想选择。The design of the DataSet makes it ideal for transporting data using XML Web services. 有关 XML Web service 的概述,请参阅 XML Web service 概述For an overview of XML Web services, see XML Web Services Overview. 有关通过 XML Web service 使用 DataSet 的示例,请参阅通过 XML Web service 使用数据集For an example of consuming a DataSet from an XML Web service, see Consuming a DataSet from an XML Web Service.

本节内容In This Section

创建数据集Creating a DataSet
描述创建 DataSet 实例的语法。Describes the syntax for creating an instance of a DataSet.

将数据表添加到数据集中Adding a DataTable to a DataSet
描述如何创建表和列并将其添加到 DataSet 中。Describes how to create and add tables and columns to a DataSet.

添加数据关系Adding DataRelations
描述如何创建 DataSet 中表之间的关系。Describes how to create relations between tables in a DataSet.

导航数据关系Navigating DataRelations
描述如何使用 DataSet 中表之间的关系来返回具有父子关系的子行或父行。Describes how to use the relations between tables in a DataSet to return the child or parent rows of a parent-child relationship.

合并数据集内容Merging DataSet Contents
描述如何将一个 DataSetDataTableDataRow 数组的内容合并到另一个 DataSet 中。Describes how to merge the contents of one DataSet, DataTable, or DataRow array into another DataSet.

复制数据集内容Copying DataSet Contents
描述如何创建可包含架构和指定数据的 DataSet 副本。Describes how to create a copy of a DataSet that can contain schema as well as specified data.

处理数据集事件Handling DataSet Events
描述 DataSet 的事件并说明如何使用这些事件。Describes the events of a DataSet and how to use them.

类型化数据集Typed DataSets
描述类型化 DataSet 的定义并说明如何创建和使用。Discusses what a typed DataSet is and how to create and use it.

数据表DataTables
描述如何创建 DataTable、定义架构和处理数据。Describes how to create a DataTable, define the schema, and manipulate data.

DataTableReaderDataTableReaders
描述如何创建和使用 DataTableReaderDescribes how to create and use a DataTableReader.

数据视图DataViews
描述如何创建和使用 DataViews 以及如何使用 DataView 事件。Describes how to create and work with DataViews and work with DataView events.

在数据集中使用 XMLUsing XML in a DataSet
描述 DataSet 如何作为数据源与 XML 进行交互(包括以 XML 数据的形式加载和保持 DataSet 的内容)。Describes how the DataSet interacts with XML as a data source, including loading and persisting the contents of a DataSet as XML data.

通过 XML Web service 使用数据集Consuming a DataSet from an XML Web Service
描述如何创建使用 DataSet 来传输数据的 XML Web services。Describes how to create an XML Web service that uses a DataSet to transport data.

ADO.NET 新增功能What's New in ADO.NET
介绍 ADO.NET 中的新增功能。Introduces features that are new in ADO.NET.

ADO.NET 概述ADO.NET Overview
提供对 ADO.NET 设计和组件的介绍。Provides an introduction to the design and components of ADO.NET.

从 DataAdapter 填充数据集Populating a DataSet from a DataAdapter
描述如何从数据源加载包含数据的数据集Describes how to load a DataSet with data from a data source.

使用 DataAdapter 更新数据源Updating Data Sources with DataAdapters
描述如何将对数据集中的数据的更改解析回数据源。Describes how to resolve changes to the data in a DataSet back to the data source.

将现有约束添加到数据集Adding Existing Constraints to a DataSet
描述如何使用数据源中的主键信息填充数据集Describes how to populate a DataSet with primary key information from a data source.

请参阅See also