Breyta

Deila með


ForeignKeyConstraint.Columns Property

Definition

Gets the child columns of this constraint.

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()

Property Value

An array of DataColumn objects that are the child columns of the constraint.

Attributes

Examples

The following example returns an array of DataColumn objects through the Columns property.

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

Applies to

See also