Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataSet.Copy vs Dataset.Clone

Tags:

Can someone explain me DataSet.Copy() vs Dataset.Clone() Also let me know some scenario's where we can use these

like image 908
Black Eagle Avatar asked May 21 '10 17:05

Black Eagle


People also ask

What is the difference between clone and copy?

clone - create something new based on something that exists. copying - copy from something that exists to something else (that also already exists).

Where can we use DataSet clone ()?

You use copy method when you don't want to affect the original data. DataSet. Clone() would copy only the schema of the DataSet object and it would return the DataSet object that has same struture that the previous dataset object which includes all the relations, constraints and schemas as well.

How do I copy a DataSet to another DataSet?

Use one of the following techniques: Use the Copy( ) method of the DataTable when all of the data for a table needs to be copied. Use the Clone( ) method of the DataTable to create the schema for each table in the destination DataSet when only a subset of the data needs to be copied.

How do you copy a DataSet?

Click Copy. In the Copy dataset dialog that appears, do the following: In the Dataset field, either create a new dataset or select an existing dataset ID from the list. Dataset names within a project must be unique.


2 Answers

Clone will create a new, empty DataSet with the same schema (tables and columns) as the old one. The new DataSet will not have any data.

Copy does the same thing, but also copies the rows in the tables.

like image 123
SLaks Avatar answered Oct 11 '22 10:10

SLaks


Clone copies the only the structure of the dataset where as Copy copies the data as well.

http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=52327

like image 23
kemiller2002 Avatar answered Oct 11 '22 11:10

kemiller2002