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

适用于

另请参阅