Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 October 29th, 2004, 09:07 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default cloning a dataset

Hi,
   i have created a simple dataset and want another
   independent copy. How can I clone dataset1 to dataset2 ???
   ( ie ending up with 2 separate copies that I can do
    manipulate separately).

   I want to avoid having to re-query a database to get the
   same data into a different dataset.

cheers muchly
chas.




 
Old November 4th, 2004, 05:57 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,
in this regard there are two methods for DataSet objects,
1-Clone
yourNewDataSet=yourDataSet.Clone();
Clones the structure of the DataSet, including all DataTable schemas, relations, and constraints.
2-Copy
yourNewDataSet=yourDataSet.Copy();
Copies both the structure and data for this DataSet,
HtH.

--------------------------------------------
Mehdi.:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with cloning or copying a list GS C# 2005 1 May 23rd, 2007 11:32 PM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Cloning a XmlTextReader billy_bob_the_3rd XML 0 March 28th, 2006 06:42 PM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





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