共用方式為


Constraint.ConstraintName 屬性

定義

ConstraintCollection 中的條件約束名稱。

public:
 virtual property System::String ^ ConstraintName { System::String ^ get(); void set(System::String ^ value); };
public virtual string ConstraintName { get; set; }
[System.Data.DataSysDescription("ConstraintNameDescr")]
public virtual string ConstraintName { get; set; }
member this.ConstraintName : string with get, set
[<System.Data.DataSysDescription("ConstraintNameDescr")>]
member this.ConstraintName : string with get, set
Public Overridable Property ConstraintName As String

屬性值

Constraint 的名稱。

屬性

例外狀況

Constraint 名稱為 null 值或空字串。

ConstraintCollection 已經包含具有相同名稱的 Constraint (該比較不區分大小寫)。

範例

下列範例會 ConstraintCollection 逐一查看 的 , DataTable 並列印每個 ConstraintName

private void PrintConstraintNames(DataTable myTable){
   foreach(Constraint cs in myTable.Constraints){
      Console.WriteLine(cs.ConstraintName);
   }
}
Private Sub PrintConstraintNames(myTable As DataTable)
    Dim cs As Constraint
    For Each cs In  myTable.Constraints
        Console.WriteLine(cs.ConstraintName)
    Next cs
End Sub

備註

ConstraintCollection 類別的 DataTable 屬性傳Constraints回 。

適用於