NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataRelation.RelationName

Gets or sets the name used to look up this relation in the parent data set's RelationsCollection.

[Visual Basic]
Overridable Public Property RelationName As String
[C#]
public string RelationName {virtual get; virtual set;}
[C++]
public: __property virtual String* get_RelationName();
public: __property virtual void set_RelationName(String*);
[JScript]
public function get RelationName() : String;
public function set RelationName(String);

Property Value

The name of the relation.

Exceptions

Exception Type Condition
ArgumentException A null or empty string ("") was passed in and the relation belongs to a collection.
DuplicateNameException The relation belongs to a collection that contains a relation of the same name. The string comparison is not case-sensitive.

Remarks

The RelationName is used to look up this relation in the parent DataSet object's RelationsCollection.

Example [Visual Basic]

The following example retrieves a named relation from a RelationsCollection.

[Visual Basic]

Private Sub GetRelation()
   Dim dRels As RelationsCollection
   ' Get the collection of a DataSet
   dRels = DataSet1.Relations
   ' Add a relation named CustomerOrders
   Dim myRel As DataRelation
   myRel = dRels("CustomerOrders")
   ' Just to make sure, print the RelationName.
   Debugl.Print myRel.RelationName   

End Sub

See Also

DataRelation Class | DataRelation Members | System.Data Namespace | DataSet | RelationsCollection | Item