Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String is not long enough
Message
De
05/02/2008 12:28:00
 
 
À
05/02/2008 10:59:55
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01289423
Message ID:
01289644
Vues:
17
Michel, do you actually *need* to have the schema included with your data? What are you doing with that data afterwards. If you can get by without using the schema (which, you should be able to, depending on what you're using it for), then all you need to do is return toDataSet.GetXml().

~~Bonnie



>>What are you doing with this Xml that you need to read it into a string? Read it into an XmlTextReader or an XmlDom to do something useful with it. XmlReader will read only a chunk at a time so it's very memory efficient but parsing is a bit difficult.
>>
>>There is no reason that I can think of to load Xml into a string.
>
>I am converting a DataSet to Xml:
>
>
>        ' Convert a DataSet into an Xml
>        ' This functions make it so the schema is included
>        ' expO1 DataSet
>        Public Function DataSetToXml(ByVal toDataSet As DataSet) As String
>            Dim lcStreamReader As StreamReader
>            Dim loMemorySteam As New MemoryStream()
>            Dim loStringBuilder As StringBuilder = New StringBuilder()
>
>            toDataSet.WriteXml(loMemorySteam, XmlWriteMode.WriteSchema)
>            loMemorySteam.Seek(0, SeekOrigin.Begin)
>            lcStreamReader = New StreamReader(loMemorySteam)
>            loStringBuilder.Append(lcStreamReader.ReadToEnd())
>            Return loStringBuilder.ToString
>        End Function
>
>
>What kind of changes would you recommend to focus on that direction?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform