Can someone explain me DataSet.Copy()
vs Dataset.Clone()
Also let me know some scenario's where we can use these
clone - create something new based on something that exists. copying - copy from something that exists to something else (that also already exists).
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With