Programatically remove DataTable from DataSet

Posted on 2008-11-06
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?
Question by:rpkhare
    LVL 2

    Accepted Solution


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

    Open in new window

    LVL 14

    Assisted Solution

    ds.Tables.Remove(<tablle object>)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One C# Help from Top Experts

    Solve your toughest problems, fast.
    C# experts are online now and ready to help you.

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now