473,468 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

Is there an easy way to do this?
Jul 21 '05 #1
2 9658
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!
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.