Share via


DataTableCollection.Clear Yöntem

Tanım

Tüm DataTable nesnelerin koleksiyonunu temizler.

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

Örnekler

Aşağıdaki örnek bir DataSetöğesini alır DataTableCollection ve ardından tüm tabloların koleksiyonunu temizler.

private void ClearTables()
{
    // Get the DataSet of a DataGrid control.
    DataSet dataSet = (DataSet)DataGrid1.DataSource;
    DataTableCollection tables = dataSet.Tables;

    // Clear the collection.
    tables.Clear();
}
Private Sub ClearTables()
   ' Get the DataSet of a DataGrid control.
   Dim dataSet As DataSet = CType(DataGrid1.DataSource, DataSet)
   Dim tables As DataTableCollection = dataSet.Tables

   ' Clear the collection.
   tables.Clear
End Sub

Açıklamalar

Koleksiyondan belirli DataTable bir öğesini kaldırmak için yöntemini kullanın Remove .

Şunlara uygulanır