Theveloper
Theveloper

Reputation: 806

VB.NET DataSet doesn't clear

I'm using the MYSQL .NET connector with an adapter to fill a dataset from a SELECT statement. Between different SELECT statements I use the DataSet.Clear() function. The Getxml shows me that the dataset is empty, however when cycling through the Table's columns, I have all the columns from all the tables used in prior SELECT statements.

How do I go about that without Dimming new Datasets for each table?

Upvotes: 1

Views: 2851

Answers (1)

Icarus
Icarus

Reputation: 63964

Remove the DataTables from the DataSet as so:

ds.Tables.Clear();

This will remove the DataTables in the collection. DataSet.Clear() removes the rows from all the DataTables in the DataSet

Upvotes: 4

Related Questions