System.Data.DataRelationCollection.Add Method

Adds a System.Data.DataRelation to the System.Data.DataRelationCollection.

Syntax

public void Add (DataRelation relation)

Parameters

relation
The DataRelation to add to the collection.

Remarks

If the relation is successfully added to the collection, the DataRelationCollection.CollectionChanged event occurs.

When a System.Data.DataRelation object is added to the collection, System.Data.ForeignKeyConstraint and System.Data.UniqueConstraint objects are created by default if they do not already exist.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0