System.Data.DataColumnCollection Class

Represents a collection of System.Data.DataColumn objects for a System.Data.DataTable.

See Also: DataColumnCollection Members

Syntax

[System.ComponentModel.DefaultEvent("CollectionChanged")]
[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.ColumnsCollectionEditor, 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 DataColumnCollection : InternalDataCollectionBase

Remarks

The System.Data.DataColumnCollection defines the schema of a System.Data.DataTable, and determines what kind of data each System.Data.DataColumn can contain. You can access the System.Data.DataColumnCollection through the DataTable.Columns property of the System.Data.DataTable object.

The System.Data.DataColumnCollection uses the DataColumnCollection.Add(DataColumn) and DataColumnCollection.Remove(DataColumn) methods to insert and delete System.Data.DataColumn objects. Use the InternalDataCollectionBase.Count property to determine how many System.Data.DataColumn objects are in the collection. Use the DataColumnCollection.Contains(string) method to verify whether a specified index or column name exists in the 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