DataRelation.ParentColumns Property

Definition

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

public virtual System.Data.DataColumn[] ParentColumns { get; }
[System.Data.DataSysDescription("DataRelationParentColumnsDescr")]
public virtual System.Data.DataColumn[] ParentColumns { get; }

Property Value

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

Attributes

Examples

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

Private Sub GetChildCols()
    ' Get the DataRelation of a DataSet.
    Dim relation As DataRelation = _
        DataSet1.Relations("CustomerOrders")

    ' Get the parent columns.
    Dim parentColumns() As DataColumn = relation.ParentColumns

    ' Print the ColumnName of each column.
    Dim i As Integer
    For i = 0 to parentColumns.GetUpperBound(0)
       Console.Writeline(parentColumns(i).ColumnName.ToString())
    Next i
End Sub

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also