' Clone this object Public Function Clone() As Object Implements System.ICloneable.Clone Dim loData As Data = DirectCast(MemberwiseClone(), Data) ' Add to the cloning object the dataset as well ' MemberwiseClone only copies value types ' So just returning Return MyBase.MemberwiseClone() would not do if after the cloning the access to the original dataset is needed loData.oDataSet = loData.oDataSet.Copy() ' If we have oDataTable If Not loData.oDataTable Is Nothing Then loData.oDataTable = loData.oDataTable.Copy() End If Return loData End FunctionBut, I assume I have to handle those ones:
Public oDataView As DataView = Nothing Public oRow As DataRow = Nothing Public oRowInitial As DataRow = Nothing Public oRows As DataRowCollection = NothingAnd, oDataView does not offer a copy. It starts to get complicated.