What is the main difference between DataSet.Clone() and DataSet.Copy() ?

 Posted by Chvrsri on 12/28/2010 | Category: ASP.NET Interview questions | Views: 6536 | Points: 40


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. This will not copy the data from the existing one to new one.

The existing Dataset ---

private DataSet CreateMyClone(DataSet myCloneDataSet) 

DataSet exampleCloneDS;
exampleCloneDS = myCloneDataSet.Clone();
return exampleCloneDS;

DataSet.Copy() will copy complete code as well as the structure of the existing DataSet object.

Source: My Own. | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response