Solved

Copy data from datagridview to datatable

Posted on 2008-10-18
2
1,236 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get Count in a variable with 5 digits always 1 28
Vb. Net application freezes 9 31
Web Form VB.Net  import CSV 4 27
VB 2005 Tooltips on Form Load Event 15 19
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

863 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

21 Experts available now in Live!

Get 1:1 Help Now