Constructs a new UniqueConstraint, and adds the constraint to the collection. An ArgumentException is thrown if this constraint already belongs to this collection, or belongs to another collection. A DuplicateNameException is thrown if this collection already has a constraint with the same name (case insensitive). The CollectionChanged event is fired if it succeeds.
[Visual Basic] Overloads Public Sub Add( _ ByVal name As String, _ ByVal columns() As DataColumn, _ ByVal primaryKey As Boolean _ ) [C#] public void Add( string name, DataColumn[] columns, bool primaryKey ); [C++] public: void Add( String* name, DataColumn* columns[], bool primaryKey ); [JScript] public function Add( name : String, columns : DataColumn[], primaryKey : Boolean );
ConstraintsCollection Class | ConstraintsCollection Members | System.Data Namespace | ConstraintsCollection.Add Overload List