471,854 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 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 14295
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Balaji Pooruli | last post: by
1 post views Thread by Jeroen Pot | last post: by
3 posts views Thread by JJ | last post: by
13 posts views Thread by Lars Netzel | last post: by
4 posts views Thread by Peter Proost | last post: by
2 posts views Thread by =?Utf-8?B?aGVuZm8=?= | last post: by
5 posts views Thread by Mark Chambers | last post: by
reply views Thread by Derek Hart | last post: by
4 posts views Thread by Soulless | last post: by
NeoPa
reply views Thread by NeoPa | last post: by

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.