Comparteix a través de


UniqueConstraint.Columns Propiedad

Definición

Obtiene la matriz de columnas a la que afecta esta restricción.

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("KeyConstraintColumnsDescr")]
public virtual System.Data.DataColumn[] Columns { get; }
member this.Columns : System.Data.DataColumn[]
[<System.Data.DataSysDescription("KeyConstraintColumnsDescr")>]
member this.Columns : System.Data.DataColumn[]
Public Overridable ReadOnly Property Columns As DataColumn()

Valor de propiedad

Matriz de objetos DataColumn.

Atributos

Ejemplos

En el ejemplo siguiente se devuelven los DataColumn objetos que restringe.UniqueConstraint

Private Sub GetColsFromConstraint()
    Dim dataColumns() As DataColumn

    ' Get a named relation from a DataSet.
    Dim dataRelation As DataRelation
    dataRelation = DataSet1.Relations("CustomerOrders")

    ' Get the ParentKeyConstraint
    Dim uniqueConstraint As UniqueConstraint
    uniqueConstraint= dataRelation.ParentKeyConstraint

    ' Get the DataColumn objects being constrained.
    dataColumns = uniqueConstraint.Columns

    ' Print the column name of each column.
    Dim i As Integer
    For i = 0 to dataColumns.GetUpperBound(0)
       Console.Write(dataColumns(i).ColumnName)
    Next i
 End Sub

Se aplica a

Consulte también