DekGenius.com
[ Team LiB ] Previous Section Next Section

ConstraintCollection serializable

System.Data (system.data.dll) class

This collection stores the constraints for a table, which it exposes through the DataTable.Constraints property. It can contain any class that derives from Constraint , including ForeignKeyConstraint and UniqueConstraint objects. You can retrieve an individual constraint by index or name.

public class ConstraintCollection : InternalDataCollectionBase {
// Public Instance Properties
   public virtual Constraint this[string name]{get; } 
   public virtual Constraint this[int index]{get; } 
// Protected Instance Properties
   protected override ArrayList List{get; }                    // overrides InternalDataCollectionBase
// Public Instance Methods
   public virtual Constraint Add(string name, DataColumn[ ] columns, bool primaryKey);
   public virtual Constraint Add(string name, DataColumn[ ] primaryKeyColumns, DataColumn[ ] foreignKeyColumns);
   public virtual Constraint Add(string name, DataColumn column, bool primaryKey);
   public virtual Constraint Add(string name, DataColumn primaryKeyColumn, DataColumn foreignKeyColumn);
   public void Add( Constraint constraint);  
   public void AddRange( Constraint[ ] constraints);  
   public bool CanRemove( Constraint constraint);  
   public void Clear(  );  
   public bool Contains( string name);  
   public int IndexOf( Constraint constraint);  
   public virtual int IndexOf( string constraintName);  
   public void Remove( Constraint constraint);  
   public void Remove( string name);  
   public void RemoveAt( int index);  
// Protected Instance Methods
   protected virtual void OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent);
// Events
   public event CollectionChangeEventHandler CollectionChanged;  
}

Hierarchy

System.Object figs/U2192.gif InternalDataCollectionBase(System.Collections.ICollection, System.Collections.IEnumerable) figs/U2192.gif ConstraintCollection

Returned By

DataTable.Constraints

    [ Team LiB ] Previous Section Next Section