Export (0) Print
Expand All

DataRelation.ParentTable Property

Gets the parent DataTable of this DataRelation.

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

Property Value

A DataTable that is the parent table of this relation.

Example

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

[Visual Basic] 
Private Sub GetParentTable()
    Dim t As DataTable
    Dim r As DataRelation
    ' Get a DataRelation of a DataSet.
    r = DataSet1.Relations("CustomerOrders")
    ' Get the parent DataTable of the relation.
    t = r.ParentTable
    ' Print the name and number of rows of the parent table.
    Debug.Write(t.TableName)
    Debug.Write(t.Rows.Count)
 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 | DataTable | ChildTable

Show:
© 2015 Microsoft