共用方式為


ForeignKeyConstraint.Columns 屬性

定義

取得這個條件約束的子資料行。

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

屬性值

DataColumn 物件 (為條件約束的子資料行) 的陣列。

屬性

範例

下列範例會透過 Columns 屬性傳回 對象的陣列DataColumn

Private Sub GetColumns()
   Dim dataColumns() As DataColumn
   Dim relation As DataRelation
   Dim i As Integer 
   ' Get the DataRelation from a DataSet.
   For Each relation In DataSet1.Relations
      If relation.GetType.ToString = _
        "System.Data.ForeignKeyConstraint" Then
        dataColumns = relation.ParentColumns
           For i = 0 To dataColumns.GetUpperBound(0)
              Console.WriteLine(dataColumns(i).ColumnName)
           Next i
      End If
   Next
End Sub

適用於

另請參閱