How do I remove table from dataset?

G

Grober

I can't seem to find a method to delete a table from a dataset. Is there a
way to do that? Using C#.

/Grober
 
J

Juan Wajnerman

Hi Grober,
you must use the Remove method from DataTableCollection:

myDataSet.Tables.Remove(myDataTable);

or by name:

myDataSet.Tables.Remove("MyTableName");
 
G

Grober

Oh, I see. I tried to do it from the table object itself, which obviously
wasn't possible. Thanks!

/Grober
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top