Copy a DataSet

Posted on 2006-04-24
Last Modified: 2010-04-23
I want to copy a DataSet into another DataSet, data and all:

Dim DataSet1 As DataSet = New DataSet
Dim DataSetOld As DataSet = New DataSet

DataSet1 has the data and I want to copy the whole thing into the a new
dataset called DataSetOld.
I want to set DataSetOld to DataSet1.  thanks
Question by:MikeMCSD
    LVL 44

    Accepted Solution

    Hello MikeMCSD,

    Dim DataSet1 As DataSet = New DataSet
    Dim DataSetOld As DataSet

    to copy the dataset including data
    DataSetOld = DataSet1.Copy

    to copy the dataset excluding data
    DataSetOld = DataSet1.Clone

    hope this helps a bit
    LVL 16

    Author Comment

    that worked . . thanks bruintje

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 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

    15 Experts available now in Live!

    Get 1:1 Help Now