473,394 Members | 1,752 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,394 software developers and data experts.

copy dataset row

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?

//both datasets have been initiablised earlier

DataRow oNewRow = oDataSet.Tables["Orders"].Rows[0];

oDataSet2.Tables["Order"].Rows.Add (oNewRow);


Nov 15 '05 #1
2 14352
This is a known issue. Your oNewRow is just a reference to a row that indeed
belongs to another table. Noone took it out of there.

Try this:

oDataSet2.Tables["Order"].Rows.Add
(oDataSet.Tables["Orders"].Rows[0].ItemArray);

HTH,

Eliyahu

"suzy" <ph******@nospamming.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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?

//both datasets have been initiablised earlier

DataRow oNewRow = oDataSet.Tables["Orders"].Rows[0];

oDataSet2.Tables["Order"].Rows.Add (oNewRow);

Nov 15 '05 #2
hi,

thanks for that. it seems to be working!
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Oh*************@tk2msftngp13.phx.gbl...
This is a known issue. Your oNewRow is just a reference to a row that indeed belongs to another table. Noone took it out of there.

Try this:

oDataSet2.Tables["Order"].Rows.Add
(oDataSet.Tables["Orders"].Rows[0].ItemArray);

HTH,

Eliyahu

"suzy" <ph******@nospamming.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
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?

//both datasets have been initiablised earlier

DataRow oNewRow = oDataSet.Tables["Orders"].Rows[0];

oDataSet2.Tables["Order"].Rows.Add (oNewRow);


Nov 15 '05 #3

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

Similar topics

3
by: Balaji Pooruli | last post by:
Hi, I have a critical requirement. I did search in the forums, but still I am not clear. Here is the requirement. Our Project (ACE) has nearly 400 DB2 tables in production and Test...
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...
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
13
by: Lars Netzel | last post by:
I'm trying to copy data from two tables in a Source db into two Tables in a Destination db and the Tables designa are the same. I created 4 adapters... 2 for the two tables in the source db...
4
by: Peter Proost | last post by:
Hello group, what would be the best way to do the next thing: I've got a grid form with about 15000 records, when I double click a row a detail form is opened and the user can modify and save...
2
by: =?Utf-8?B?aGVuZm8=?= | last post by:
Hi, I am working on program to cop data from the main database (Oracle or SQL Server) to a local Access-database used on laptops. The databse is quite large so the routine nedds to be fast. The...
5
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke...
0
by: Derek Hart | last post by:
Having trouble using dotnet 2.0 code to move a dataset filled with data to a remote server. Works perfectly locally, but always times out with a remote server. Is there some property or something...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.