Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String is not long enough
Message
From
05/02/2008 12:28:00
 
 
To
05/02/2008 10:59:55
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01289423
Message ID:
01289644
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform