[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Programatically remove DataTable from DataSet

Posted on 2008-11-06
2
Medium Priority
?
4,931 Views
Last Modified: 2013-12-17
I created a DataTable programatically in my DataSet and now I want to remove this DataTable from the DataSet in a similar way. How to do this?
0
Comment
Question by:rpkhare
2 Comments
 
LVL 2

Accepted Solution

by:
kerwinsiy earned 90 total points
ID: 22893110


 
            DataSet ds = new DataSet();
//add datatable on dataset
            ds.Tables.Add();
// cast datatable as dt
            DataTable dt = ds.Tables[0];
// remove dt on dataset
            ds.Tables.Remove(dt);

Open in new window

0
 
LVL 14

Assisted Solution

by:Binuth
Binuth earned 60 total points
ID: 22893114
ds.Tables.RemoveAt(0)
ds.Tables.Remove(<tablle object>)
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question