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")
        Dim node As Xml.XmlNode = xmlDoc.ReadNode(reader)
        While node IsNot Nothing
            node = xmlDoc.ReadNode(reader)
        End While
        xmlDoc.Save(_rootDir & "\HistoryReport.xml")
    End Sub

Open in new window

Who is Participating?
jjardineConnect With a Mentor Commented:
Have a look at these posts regarding this topic:  

I hope that helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.