DataTableCollection.Clear Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Clears the collection of all DataTable objects.
public:
void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()
Examples
The following example gets the DataTableCollection of a DataSet, and then clears the collection of all tables.
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
Remarks
To remove a particular DataTable
from the collection, use the Remove method.
Applies to
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.