DataRelation.RelationName Property

Gets or sets the name used to retrieve a DataRelation from the DataRelationCollection.

Namespace: System.Data
Assembly: System.Data (in

public virtual string RelationName { get; set; 
/** @property */
public String get_RelationName ()

/** @property */
public void set_RelationName (String value)

public function get RelationName () : String

public function set RelationName (value : String)

Property Value

The name of the a DataRelation.

Exception typeCondition


a null reference (Nothing in Visual Basic) or empty string ("") was passed into a DataColumn that is a DataRelation.


The DataRelation belongs to a collection that already contains a DataRelation with the same name.

Use the RelationName property to retrieve a DataRelation from the DataRelationCollection.

The following example uses the RelationName property to retrieve a DataRelation from a DataRelationCollection.

Private Sub GetRelation()
    ' Get the collection of a DataSet.
    Dim collection As DataRelationCollection = _

    ' Add a relation named CustomerOrders.
    Dim myRel As DataRelation = _

    ' Print the RelationName.
End Sub

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0