4、ADO。NET DataSets

The DataSet object is central to supporting disconnected, distributed data scenarios with ADO。NET。 The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source。 It can be used with multiple and differing data sources, with XML data, or to manage data local to the application。 The DataSet represents a complete set of data, including related tables, constraints, and relationships among the tables。 The following illustration shows the DataSet object model。 

DataSet object model

The methods and objects in a DataSet are consistent with those in the relational database model。 

The DataSet can also persist and reload its contents as XML, and its schema as XML schema definition language (XSD) schema。

The DataTableCollection 

An ADO。NET DataSet contains a collection of zero or more tables represented by DataTable objects。 The DataTableCollection contains all the DataTable objects in a DataSet。 

A DataTable is defined in the System。Data namespace and represents a single table of memory-resident data。 It contains a collection of columns represented by a DataColumnCollection, and constraints represented by a ConstraintCollection, which together define the schema of the table。 A DataTable also contains a collection of rows represented by the DataRowCollection, which contains the data in the table。 Along with its current state, a DataRow retains both its current and original versions to identify changes to the values stored in the row。 

The DataView Class 

A DataView enables you to create different views of the data stored in a DataTable, a capability that is often used in data-binding applications。 Using a DataView, you can expose the data in a table with different sort orders, and you can filter the data by row state or based on a filter expression。 

The DataRelationCollection 

A DataSet contains relationships in its DataRelationCollection object。 A relationship, represented by the DataRelation object, associates rows in one DataTable with rows in another DataTable。 A relationship is analogous to a join path that might exist between primary and foreign key columns in a relational database。 A DataRelation identifies matching columns in two tables of a DataSet。 

Relationships enable navigation from one table to another in a DataSet。 The essential elements of a DataRelation are the name of the relationship, the name of the tables being related, and the related columns in each table。 Relationships can be built with more than one column per table by specifying an array of DataColumn objects as the key columns。 When you add a relationship to the DataRelationCollection, you can optionally add a UniqueKeyConstraint and a ForeignKeyConstraint to enforce integrity constraints when changes are made to related column values。 

XML 

You can fill a DataSet from an XML stream or document。 You can use the XML stream or document to supply to the DataSet either data, schema information, or both。 The information supplied from the XML stream or document can be combined with existing data or schema information already present in the DataSet。 

ExtendedProperties 

The DataSet, DataTable, and DataColumn all have an ExtendedProperties property。 ExtendedProperties is a PropertyCollection where you can place custom information, such as the SELECT statement that was used to generate the result set, or the time when the data was generated。 The ExtendedProperties collection is persisted with the schema information for the DataSet。 

LINQ to DataSet 

LINQ to DataSet provides language-integrated querying capabilities for disconnected data stored in a DataSet。 LINQ to DataSet uses standard LINQ syntax and provides compile-time syntax checking, static typing, and IntelliSense support when you are using the Visual Studio IDE。 

上一篇:齿轮平行转子系统英文文献和中文翻译
下一篇:电子商务英文文献及中文翻译

未加筋的低屈服点钢板剪...

会计师事务所任期与审计...

信息系统开发与数据库开...

升式单位上升操作结构英文文献和中文翻译

机器人学入门力学与控制英文文献和中文翻译

园林植物景观的园林绿化...

基卡气体管道PLEM结构的原...

LiMn1-xFexPO4正极材料合成及充放电性能研究

新課改下小學语文洧效阅...

互联网教育”变革路径研究进展【7972字】

我国风险投资的发展现状问题及对策分析

ASP.net+sqlserver企业设备管理系统设计与开发

麦秸秆还田和沼液灌溉对...

安康汉江网讯

张洁小说《无字》中的女性意识

老年2型糖尿病患者运动疗...

网络语言“XX体”研究