共用方式為


DataRelation.ParentColumns 屬性

定義

取得為這個 DataColumn 父資料行的 DataRelation 物件陣列。

public:
 virtual property cli::array <System::Data::DataColumn ^> ^ ParentColumns { cli::array <System::Data::DataColumn ^> ^ get(); };
public virtual System.Data.DataColumn[] ParentColumns { get; }
[System.Data.DataSysDescription("DataRelationParentColumnsDescr")]
public virtual System.Data.DataColumn[] ParentColumns { get; }
member this.ParentColumns : System.Data.DataColumn[]
[<System.Data.DataSysDescription("DataRelationParentColumnsDescr")>]
member this.ParentColumns : System.Data.DataColumn[]
Public Overridable ReadOnly Property ParentColumns As DataColumn()

屬性值

DataColumn 物件 (為這個 DataRelation 的父資料行) 的陣列。

屬性

範例

下列範例會取得做為關聯父數據行之對象的陣列 DataColumn

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

適用於

另請參閱