473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I copy one dataset table to another dataset table?

Is there an easy way to do this?
Jul 21 '05 #1
2 9650
Keeping in mind that datatables are Reference types and the copy is simply
a copy of the reference (ie any changes you make to the copy will be
reflected in the original), this should work for you:

Dim dt As New DataTable

Dim dt2 As New DataTable

Dim ds1 As New DataSet

Dim ds2 As New DataSet

ds1.Tables.Add(dt)

dt2 = dt.Copy()

ds2.Tables.Add(dt2)

However, you can make a deep copy wherin you create a new table and set each
value of the new field to the value of the sourdce...

"Top Gun" <nf*@nospam.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
Is there an easy way to do this?

Jul 21 '05 #2
Cor
Hi Bill are you sure of that?
Keeping in mind that datatables are Reference types and the copy is simply
a copy of the reference (ie any changes you make to the copy will be
reflected in the original), this should work for you:


Datatable.copy
A new DataTable with the same structure (table schemas and constraints) and
data as this DataTable.

What you say is as far as I know.
DataTable Dt;
Dt = DtOld;

But maybe I am wrong?

:-)

Cor
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: suzy | last post by:
hi im trying to copy a row from one dataset table to another dataset table. i tried the following but it says the row belongs to another table. any idea what im doing wrong, or if its possible?...
1
by: Jeroen Pot | last post by:
Hi, I have a dataset "Mydataset" which contains of a few fields. (lets say dept_id and dept_name) A user can select several of these, and i want to export this to an access database. I have...
0
by: Bennett Haselton | last post by:
If I have just filled a DataTable in a typed DataSet with a single row, is there a way I can make a copy of that row, so that I can clear the DataTable in that DataSet and use it for another query,...
2
by: ecoder | last post by:
Hi I'm looking for some help regarding copying, selected datagrid items from one dataset to another... and then bind the new dataset to a another datagrid. Hope hearing from you. --...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
6
by: chreo | last post by:
Sorry for weird title and sorry for my English (I'm from Poland). This is the problem: I have form with many controls. There are three comboboxes - each should have table STREETS as DataSource....
2
by: Top Gun | last post by:
Is there an easy way to do this?
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
4
by: Soulless | last post by:
Hi, is there any way to copy a dataset to a datagrid? I have a dataset and want to copy to a datagridview, but I get no results.... thx!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.