This collection contains DataColumn objects for a DataTable. This collection is accessed using the DataTable.Columns property. You can retrieve an individual DataColumn by name or index.

public class DataColumnCollection : InternalDataCollectionBase {

// Public Instance Properties

   public virtual DataColumn this[string 


                  ]{get; } 

   public virtual DataColumn this[int 


                  ]{get; } 

// Protected Instance Properties

   protected override ArrayList List{get; }              // overrides InternalDataCollectionBase

                  // Public Instance Methods

   public virtual DataColumn Add( );  

   public virtual DataColumn Add(string columnName);  

   public virtual DataColumn Add(string columnName, Type type); 

   public virtual DataColumn Add(string columnName, Type type, string expression);

   public void Add(DataColumn column);  

   public void AddRange(DataColumn[ ] columns);  

   public bool CanRemove(DataColumn column);  

   public void Clear( );  

   public bool Contains(string name);  

   public virtual int IndexOf(DataColumn column);  

   public int IndexOf(string columnName);  

   public void Remove(DataColumn column);  

   public void Remove(string name);  

   public void RemoveAt(int index);  

// Protected Instance Methods

   protected virtual void OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent);

   protected internal virtual void OnCollectionChanging(System.ComponentModel.CollectionChangeEventArgs ccevent); 

// Events

   public event CollectionChangeEventHandler CollectionChanged;  



System.Object InternalDataCollectionBase(System.Collections.ICollection ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.