UniqueConstraint.Columns 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得這個條件約束影響的資料行陣列。
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()
屬性值
DataColumn 物件的陣列。
- 屬性
範例
下列範例會傳 DataColumn 回 限制的物件 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