Represents one table of in-memory data.
Assembly: System.Data (in System.Data.dll)
When accessing objects, note that they are conditionally case sensitive. For example, if one 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. A DataSet can contain two objects that have the same TableName property value but different Namespace property values. For more information about working with objects, see Creating a DataTable (ADO.NET).
If you are creating a programmatically, you must first define its schema by adding DataColumn objects to the DataColumnCollection (accessed through the Columns property). For more information about adding DataColumn objects, see Adding Columns to a DataTable (ADO.NET).
To add rows to a , you must first use the NewRow method to return a new DataRow object. The NewRow method returns a row with the schema of the , as it is defined by the table's DataColumnCollection. The maximum number of rows that a can store is 16,777,216. For more information, see Adding Data to a DataTable (ADO.NET).
There are many events that can be used to determine when changes are made to a table. These include RowChanged, RowChanging, RowDeleting, and RowDeleted. For more information about the events that can be used with a , see Handling DataTable Events (ADO.NET).
When an instance of is created, some of the read/write properties are set to initial values. For a list of these values, see the DataTable.DataTable constructor topic.
The DataSet and objects inherit from MarshalByValueComponent, and support the ISerializable interface for .NET Framework remoting. These are the only ADO.NET objects that you can use for .NET Framework remoting.
|How to: Create DataTables||Data Access 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.