Hi
I have an xsd that I want to save as an XML string to store in a DB
I can save as a physical file using
xsd.WriteXml(@" C:\Temp\Junk\ju nk.xml");
But I am unable to save to a string so I can write string to a db
I tried to a MemoryStream but it seems to be empty ???
There is data
because the above WriteXML files a text file
MemoryStream ms = new MemoryStream();
xsd.WriteXml(ms );
// Create a stream reader.
StreamReader reader = new StreamReader(ms );
// Just read to the end.
string sXMLFile = reader.ReadToEn d();
Thanks
I have an xsd that I want to save as an XML string to store in a DB
I can save as a physical file using
xsd.WriteXml(@" C:\Temp\Junk\ju nk.xml");
But I am unable to save to a string so I can write string to a db
I tried to a MemoryStream but it seems to be empty ???
There is data
because the above WriteXML files a text file
MemoryStream ms = new MemoryStream();
xsd.WriteXml(ms );
// Create a stream reader.
StreamReader reader = new StreamReader(ms );
// Just read to the end.
string sXMLFile = reader.ReadToEn d();
Thanks
Comment