469,140 Members | 1,313 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

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 14187
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
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.