Solved

Copy data from datagridview to datatable

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

22 Experts available now in Live!

Get 1:1 Help Now