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 名称是空值或空字符串。

ConstraintCollection 已经包含同名称的 Constraint(比较不区分大小写。)

示例

以下示例循环访问 ConstraintCollectionDataTable ,并打印每个 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

注解

ConstraintCollectionConstraints 类的 DataTable 属性返回。

适用于