Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I know it is probably obvious, but I tried dataset.Tables(TableName).Dispose(), but it doesn't 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 dataset's Table?

 

Barry

Edited by byoung
  • *Experts*
Posted

You want to use Clear() if you're trying to remove the *rows* from the DataTable. If you want to clear them from database, you'll need to Delete() them and then call the DataTable (or DataSet's?) Update() method.

 

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

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...