Solved

Copy data from datagridview to datatable

Posted on 2008-10-18
2
1,239 Views
Last Modified: 2008-10-19
I have a datagridview on a form that is populated from a datatable in dataset1. I want to take all that data and copy to an identical datatable in dataset2.
0
Comment
Question by:wiswalld
  • 2
2 Comments
 

Expert Comment

by:brenkehoe777
ID: 22749787
This should work
DataTable dt = new DataTable();
                dt = ds1.Tables[0];
                DataSet ds2 = new DataSet();
                ds.Tables.Add(dt);

Open in new window

0
 

Accepted Solution

by:
brenkehoe777 earned 250 total points
ID: 22749800
In vb.net
Dim dt As New DataTable()
dt = ds1.Tables(0)
Dim ds2 As New DataSet()
ds.Tables.Add(dt)

Open in new window

0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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