CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    49

    XmlDocument load function is giving Out of Memory Exception For large XML file(135mb)

    Hi,

    XmlDocument xmlDom = new XmlDocument();
    xmlDom.Load("D:\CPDCL_01HW342889_ALL_new.xml");

    according to me Innerxml data member of XmlDocument can not able to hold this large string data,
    as its showing innerxml out of memmory exception when we load the xml.
    since xml file is 135 mb, so we can not attach.so please let me know how to load the large (135mb)
    xml file.
    so we are waiting for ur reply.


    Thanks
    Abhi

  2. #2
    Join Date
    Dec 2011
    Posts
    61

    Re: XmlDocument load function is giving Out of Memory Exception For large XML file(13


  3. #3
    Join Date
    May 2007
    Posts
    1,546

    Re: XmlDocument load function is giving Out of Memory Exception For large XML file(13

    Use XmlReader instead of XmlDocument. It's a forward-only parser which does not require all of the data to be in memory at one time.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured