Bagikan melalui


ConstraintCollection.Clear Metode

Definisi

Menghapus koleksi objek apa pun Constraint .

public:
 void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()

Contoh

Contoh berikut menghapus semua batasan dari ConstraintCollection.


public static void ClearConstraints(DataSet dataSet)
{
   foreach (DataTable table in dataSet.Tables)
     table.Constraints.Clear();
}
Public Shared Sub ClearConstraints(dataSet As DataSet) 
   Dim table As DataTable
   For Each table In dataSet.Tables
     table.Constraints.Clear()
   Next
End Sub

Keterangan

Peristiwa CollectionChanged terjadi jika tindakan ini berhasil.

Berlaku untuk