Have you ever used the Clone() method of DataSet? This method creates an empty class with same structure as original DataSet. You can write your own clonable classes. To do so, you must implement IClonable. The following code shows a clonable Test class. using System.IO; using System.Runtime.Serialization.Formatters.Binary; public Class Test : IClonable
Have you ever used the Clone() method of DataSet? This method creates an empty class with same structure as original DataSet.
You can write your own clonable classes. To do so, you must implement IClonable. The following code shows a clonable Test class.
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
public
{
public Test()
}
// deep copy in separeate memory space
public object Clone()
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, this);
ms.Position = 0;
object obj = bf.Deserialize(ms);
ms.Close();
return obj;
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: