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
public virtual DataSet DataSet {get;}
public: __property virtual DataSet* get_DataSet();
public function get DataSet() : DataSet;

Property Value

A DataSet to which the DataRelation belongs.


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


[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
 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.


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