Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verification on cloning
Message
De
14/01/2015 09:46:23
 
 
À
10/12/2014 12:18:52
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612064
Message ID:
01613602
Vues:
63
>There's another way - not that I'm sure it will solve the errors - you'll have to test it
>
>			DataSet ds1 = ds.DataSet;   // the original
>
>			DataSet ds2 = ds1.Clone(); // cloned
>
>			using (MemoryStream contents = new MemoryStream())
>			{
>				ds1.WriteXml(contents);  // save contents to a stream
>				contents.Position = 0;
>				ds2.ReadXml(contents);
>			}
>
Thanks, I tried that. But, it does not work. It is the same result. This does not create a copy.
    ' Clone this object
    Public Function Clone() As Object Implements System.ICloneable.Clone
        Dim loData As Data = DirectCast(MemberwiseClone(), Data)
        Dim loDataSet As DataSet = Nothing

        loDataSet = oDataSet.Clone

        Using loMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream
            oDataSet.WriteXml(loMemoryStream)
            loMemoryStream.Position = 0
            loDataSet.ReadXml(loMemoryStream)
        End Using

        loData.oDataSet = loDataSet

        Return loData
    End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform