Could somebody please point out my error in the following code. The
dataset is returned by a stored procedure containing FOR XML AUTO,
ELEMENTS, but the XML Document that is created contains < and >
instead of < and >. I have tried everything that I can think of
without any success, which probably means that I am missing something
obvious.
Dim dsERF As New DataSet
dsERF = clsList.TableData
Dim filename As String = "C:\Inetpub\wwwroot\ISSPost
\NewXmlDoc.xml"
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
Dim myXmlWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
myXmlWriter.Formatting = System.Xml.Formatting.Indented
dsERF.WriteXml(myXmlWriter, XmlWriteMode.IgnoreSchema)
myXmlWriter.Close()
The generated XML appears as follows.
<NewDataSet>
<Table>
<XML_F52E2B61-18A1-11d1-B105-00805F49916B><row Message="No
records were found. Please change at least one dropdown selection."/
></XML_F52E2B61-18A1-11d1-B105-00805F49916B>
</Table>
</NewDataSet>