This class contains a collection of DataTable objects and is accessed using the DataSet.Tables property. DataTable objects can be retrieved by table name or index.

public class DataTableCollection : InternalDataCollectionBase {

// Public Instance Properties

   public DataTable this[string 


                  ]{get; } 

   public DataTable this[int 


                  ]{get; } 

// Protected Instance Properties

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

                  // Public Instance Methods

   public virtual DataTable Add( );  

   public virtual DataTable Add(string name);  

   public virtual void Add(DataTable table);  

   public void AddRange(DataTable[ ] tables);  

   public bool CanRemove(DataTable table);  

   public void Clear( );  

   public bool Contains(string name);  

   public virtual int IndexOf(DataTable table);  

   public virtual int IndexOf(string tableName);  

   public void Remove(DataTable table);  

   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;  

   public event CollectionChangeEventHandler CollectionChanging;  



System.Object InternalDataCollectionBase(System.Collections.ICollection, System.Collections.IEnumerable) DataTableCollection

Returned By

DataSet.Tables ...

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.