System.Data.DataTableCollection Class

Represents the collection of tables for the System.Data.DataSet.

See Also: DataTableCollection Members

Syntax

[System.ComponentModel.ListBindable(false)]
[System.ComponentModel.DefaultEvent("CollectionChanged")]
[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.TablesCollectionEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed class DataTableCollection : InternalDataCollectionBase

Remarks

The System.Data.DataTableCollection contains all the System.Data.DataTable objects for a particular System.Data.DataSet. To access the System.Data.DataTableCollection of a System.Data.DataSet, use the DataSet.Tables property.

The System.Data.DataTableCollection uses methods such as DataTableCollection.Add(DataTable), DataTableCollection.Clear, and DataTableCollection.Remove(DataTable) to manage the items in the collection.

Use the DataTableCollection.Contains(string) method to determine whether a particular table (specified by either index or name) is in the collection.

To navigate from one table to another, use the DataTable.ChildRelations or DataTable.ParentRelations property of the System.Data.DataTable to access its collection of System.Data.DataRelation objects. You can also use the DataSet.Relations property to navigate through the parent/child relationships of the DataTables in a particular System.Data.DataSet collection.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0