UniqueConstraint.Columns Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the array of columns that this constraint affects.
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()
Property Value
An array of DataColumn objects.
- Attributes
Examples
The following example returns the DataColumn objects that the UniqueConstraint constrains.
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
Applies to
See also
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.