Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copy data from datagridview to datatable

Posted on 2008-10-18
2
Medium Priority
?
1,286 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Screencast - Getting to Know the Pipeline
Suggested Courses

916 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