Link to home
Start Free TrialLog in
Avatar of easy_life
easy_life

asked on

Retrieve data from database and insert the XML content to an XML Reader.

I am getting this error "There is an unclosed literal string. Line 1, position 2048." while reading from the XML reader.
If I read small amount of data it is working fine but if I read more than 2048 characters data I am getting this error. Can anyone tell me, how can I solve this problem?
I use the following code for XML reader.
Private Sub GenerateXMLReport(ByVal query As String)
 
        Dim reader As System.Xml.XmlReader
        reader = CreateXMLReader(query, _cs)
 
 
        Dim xmlDoc As New System.Xml.XmlDocument()
        Dim root As Xml.XmlElement = xmlDoc.CreateElement("Report")
        xmlDoc.AppendChild(root)
 
 
        Dim node As Xml.XmlNode = xmlDoc.ReadNode(reader)
        While node IsNot Nothing
            root.AppendChild(node)
            node = xmlDoc.ReadNode(reader)
        End While
 
        xmlDoc.Save(_rootDir & "\HistoryReport.xml")
 
    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jjardine
jjardine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial