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

Posted on 2008-11-12
Last Modified: 2012-05-05
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

Question by:easy_life
    1 Comment
    LVL 14

    Accepted Solution

    Have a look at these posts regarding this topic:  

    I hope that helps.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now