Export (0) Print
Expand All

DataRelation.ParentColumns Property

Gets an array of DataColumn objects that are the parent columns of this DataRelation.

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

Property Value

An array of DataColumn objects that are the parent columns of this DataRelation.

Example

[Visual Basic] The following example gets the array of DataColumn objects that function as parent columns for the relation.

[Visual Basic] 
Private Sub GetChildCols()
    Dim ParentArr() As DataColumn
    ' Get the DataRelation of a DataSet.
    Dim dr As DataRelation
    dr = DataSet1.Relations("CustomerOrders")
    ' Get the child columns.
    ParentArr= dr.ParentColumns
    ' Print the ColumnName of each column.
    Dim i As Integer
    For i = 0 to ParentArr.GetUpperBound(0)
       Debug.Write(ParentArr(i).ColumnName)
    Next i
 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 | DataColumn | ChildColumns

Show:
© 2015 Microsoft