This documentation is archived and is not being maintained.

DataRelation.DataSet Property

Gets the DataSet to which the DataRelation belongs.

[Visual Basic]
Public Overridable ReadOnly Property DataSet As DataSet
[C#]
public virtual DataSet DataSet {get;}
[C++]
public: __property virtual DataSet* get_DataSet();
[JScript]
public function get DataSet() : DataSet;

Property Value

A DataSet to which the DataRelation belongs.

Remarks

The DataRelationCollection associated with a DataSet is accessed through the Relations property of the DataSet object.

Example

[Visual Basic] The following example gets the DataSet of a DataRelation.

[Visual Basic] 
Private Sub GetRelDataSet(myRelation As DataRelation)
    ' Get the DataSet of the passed in DataRelation.
    Dim ds As DataSet
    ds = myRelation.DataSet
    ' Print the table names of each table in the DataSet.
    Dim t As DataTable
    For Each t In ds.Tables
        Debug.Write(t.TableName)
    Next
 End Sub

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataRelation Class | DataRelation Members | System.Data Namespace | DataSet | Relations | DataRelationCollection

Show: