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!

RelationsCollection.Add (String, DataColumn, DataColumn)

Creates a relation given the parameters and adds it to the collection. An ArgumentException is thrown if this relation already belongs to this collection or belongs to another collection. A DuplicateNameException is thrown if this collection already has a relation with the same name (case insensitive). An InvalidConstraintException is thrown if the relation can't be created based on the parameters. The CollectionChanged event is fired if it succeeds.

[Visual Basic]
Overloads Overridable Public Function Add( _
   ByVal name As String, _
   ByVal parentColumn As DataColumn, _
   ByVal childColumn As DataColumn _
) As DataRelation
[C#]
public virtual DataRelation Add(
   string name,
   DataColumn parentColumn,
   DataColumn childColumn
);
[C++]
public: virtual DataRelation* Add(
   String* name,
   DataColumn* parentColumn,
   DataColumn* childColumn
);
[JScript]
public function Add(
   name : String,
   parentColumn : DataColumn,
   childColumn : DataColumn
) : DataRelation;

Parameters

name
The name of the relation.
parentColumn
parent column of relation.
childColumn
child column of relation.

Return Value

The created relation.

See Also

RelationsCollection Class | RelationsCollection Members | System.Data Namespace | RelationsCollection.Add Overload List