Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy data from datagridview to datatable

Posted on 2008-10-18
2
Medium Priority
?
1,272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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 …
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

660 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