''ConstraintCollection'' ''serializable'

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;  


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

Returned By


    Part I: ADO.NET Tutorial
    Part II: ADO.NET Core Classes
    Part III: API Quick Reference
    Chapter 34. The System.Data Namespace