Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2004, 11:31 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default Copying data set rows

Hell all,

   I wanted to do something which I though was fairly simple, but I seem to be have trouble finding how to do it.
   What I want to do is copy rows from a dataset table into another table in another dataset. (ex ds1.table(0).rows.copyto ds2.table(0)) The schemas are exactly the same. I can't seem to find the right syntax. Can anyone help?

Thanks,

Jim

 
Old September 15th, 2004, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can copy a datatable entirely by:

ds2.tables.add(ds1.tables(0).copy())

I believe there may be a copy() method for the row too, but I'm not sure.

Brian
 
Old September 15th, 2004, 02:30 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

thanks, but I do not want to copy the entire table since I have the structure setup already. I am using ImportRow() and that works, however I am getting NULLs on the key column. That is the new problem :)

thanks again

 
Old September 15th, 2004, 03:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

You can't add a row to two tables, because it gives you an ownership error, I believe if I remember correctly...

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping columns and then copying data Roshanjoshi2001 Excel VBA 0 December 10th, 2007 11:37 AM
Copying Rows to New worksheet eusanpe Excel VBA 7 December 21st, 2006 10:23 AM
Copying data across files sda443 Excel VBA 2 January 16th, 2006 06:49 AM
Copying Multiple Rows raj_phoenix Excel VBA 3 May 6th, 2005 03:58 AM
Copying Multiple Rows in MS Excel 2K using VB .Net Azhar Akbari Excel VBA 2 January 27th, 2005 10:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.