Constraint.ConstraintName 属性
定义
ConstraintCollection 中的约束的名称。The name of a constraint in the 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 的名称。The name of the Constraint.
- 属性
例外
Constraint 名称是空值或空字符串。The Constraint name is a null value or empty string.
ConstraintCollection 已经包含同名称的 Constraint(比较不区分大小写。)The ConstraintCollection already contains a Constraint with the same name (The comparison is not case-sensitive.).
示例
下面的示例循环访问 ConstraintCollection 的 DataTable ,并打印每个 ConstraintName 。The following example iterates through the ConstraintCollection of a DataTable and prints each 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由类的属性返回 Constraints DataTable 。The ConstraintCollection is returned by the Constraints property of the DataTable class.