Clearing or Deleting a Dataset.

byoung

Member
Joined
Jan 23, 2003
Messages
9
I know it is probably obvious, but I tried dataset.Tables(TableName).Dispose(), but it doesnt clear or delete the table by name.

The next fill with the same tablename adds to the end of the dataset.tables(TableName).

How do I Clear or Delete a datasets Table?

Barry
 
Last edited by a moderator:
You want to use Clear() if youre trying to remove the *rows* from the DataTable. If you want to clear them from database, youll need to Delete() them and then call the DataTable (or DataSets?) Update() method.

Dispose is a .NET mechanism for cleaning up resources on objects. Youll pretty much never use it on a DataSet, DataTable, etc.

-nerseus
 
Back
Top