Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting dataset to xml
Message
From
27/10/2005 14:59:18
 
 
To
27/10/2005 12:34:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
01062521
Message ID:
01062744
Views:
26
>>Hi Cetin,
>>
>>thanks for your answer.
>>
>>
>>>   private void WriteDataSetToXMLFile(DataSet ds, string filename)
>>>   {
>>>	if (ds == null) { return; }
>>>	XmlTextWriter xmlWr = new XmlTextWriter(filename, Encoding.UTF8);
>>>	xmlWr.Formatting = Formatting.Indented;
>>>	XmlSerializer xs = new XmlSerializer(typeof(DataSet));
>>>	xs.Serialize(xmlWr, ds);
>>>	xmlWr.Close();
>>>   }
>>
>>
>>This method writes to a file.
>>How can I change it to return the XML string as a return value of the method?
>
>You could use a memorystream:
>
>MemoryStream ms = new MemoryStream();
>XmlTextWriter xmlWr = new XmlTextWriter(ms, Encoding.UTF8);
>
>Cetin

Thanks Cetin, but I think I don't understand what exactly to do.
Can you complete the function?
I find this a bit confusing.
Holger Vorberg
Germany
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform