System.Data.DataRelationCollection Class

Represents the collection of System.Data.DataRelation objects for this System.Data.DataSet.

See Also: DataRelationCollection Members

Syntax

[System.ComponentModel.DefaultProperty("Table")]
[System.ComponentModel.DefaultEvent("CollectionChanged")]
[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.DataRelationCollectionEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public abstract class DataRelationCollection : InternalDataCollectionBase

Remarks

A System.Data.DataRelationCollection object enables navigation between related parent/child System.Data.DataTable objects.

You create a System.Data.DataRelationCollection object by defining it as a property of either the System.Data.DataSet or the System.Data.DataTable, instead of by directly using a constructor. (Use the DataSet.Relations property of the System.Data.DataSet, or the DataTable.ParentRelations property of the System.Data.DataTable.)

To access the collection, use the DataSet.Relations property of the System.Data.DataSet object.

As soon as the collection exists you can manage the objects it contains by using methods such as DataRelationCollection.Add(DataRelation), DataRelationCollection.Clear, and DataRelationCollection.Remove(DataRelation).

Requirements

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