Bagikan melalui


Constraint.ConstraintName Properti

Definisi

Nama batasan di 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

Nilai Properti

Nama Constraint.

Atribut

Pengecualian

Nama Constraint adalah nilai null atau string kosong.

ConstraintCollection sudah berisi Constraint dengan nama yang sama (Perbandingan tidak peka huruf besar/kecil.).

Contoh

Contoh berikut berulang melalui ConstraintCollection dari DataTable dan mencetak masing-masing 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

Keterangan

ConstraintCollection dikembalikan oleh Constraints properti kelas DataTable .

Berlaku untuk