Represents an in-memory cache of data.
Assembly: System.Data (in System.Data.dll)
The , which is an in-memory cache of data retrieved from a data source, is a major component of the ADO.NET architecture. The consists of a collection of DataTable objects that you can relate to each other with DataRelation objects. You can also enforce data integrity in the by using the UniqueConstraint and ForeignKeyConstraint objects. For further details about working with objects, see DataSets, DataTables, and DataViews (ADO.NET).
Whereas DataTable objects contain the data, the DataRelationCollection allows you to navigate though the table hierarchy. The tables are contained in a DataTableCollection accessed through the Tables property. When accessing DataTable objects, note that they are conditionally case sensitive. For example, if one DataTable is named "mydatatable" and another is named "Mydatatable", a string used to search for one of the tables is regarded as case sensitive. However, if "mydatatable" exists and "Mydatatable" does not, the search string is regarded as case insensitive. For more information about working with DataTable objects, see Creating a DataTable (ADO.NET).
A can read and write data and schema as XML documents. The data and schema can then be transported across HTTP and used by any application, on any platform that is XML-enabled. You can save the schema as an XML schema with the WriteXmlSchema method, and both schema and data can be saved using the WriteXml method. To read an XML document that includes both schema and data, use the ReadXml method.
In a typical multiple-tier implementation, the steps for creating and refreshing a , and in turn, updating the original data are to:
Invoke the GetChanges method to create a second that features only the changes to the data.
Invoke the Merge method to merge the changes from the second into the first.
Classes inherited from are not finalized by the garbage collector, because the finalizer has been suppressed in . The derived class can call the ReRegisterForFinalize method in its constructor to allow the class to be finalized by the garbage collector.
|How to: Create a Typed Dataset||Data Access in Visual Studio|
|Walkthrough: Displaying Hierarchical Data in a TreeView Control||Building ASP .NET Web Applications in Visual Studio|
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.