Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to read Fast Large Xml File

how to read Fast Large Xml File

Scheduled Pinned Locked Moved C#
comxmltutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sanjib Raj
    wrote on last edited by
    #1

    Plz give me supar fast method for reading Large Xml File of 4MB to 10MB. i have used the following code but it is also slow for my Application. 1 st way-> FileStream sr=new FileStream ("C:\test.Xml",FileMode.Open); XmlTextRader rd=new XmlTextReader(sr); Whlie(rd.Read()) { // ----- // } Second way-> FileInfo sr=new FileInfo ("C:\Test.Xml"); XmlTextRader rd=new XmlTextReader(sr.OpenRead()); Whlie(rd.Read()) { // ----- // } Sanjit.rajbanshi@wlinktech.com

    L D 2 Replies Last reply
    0
    • S Sanjib Raj

      Plz give me supar fast method for reading Large Xml File of 4MB to 10MB. i have used the following code but it is also slow for my Application. 1 st way-> FileStream sr=new FileStream ("C:\test.Xml",FileMode.Open); XmlTextRader rd=new XmlTextReader(sr); Whlie(rd.Read()) { // ----- // } Second way-> FileInfo sr=new FileInfo ("C:\Test.Xml"); XmlTextRader rd=new XmlTextReader(sr.OpenRead()); Whlie(rd.Read()) { // ----- // } Sanjit.rajbanshi@wlinktech.com

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      How about : XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"C:\Test.Xml");

      D 1 Reply Last reply
      0
      • L Lost User

        How about : XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"C:\Test.Xml");

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #3

        That is not faster at all.


        "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

        1 Reply Last reply
        0
        • S Sanjib Raj

          Plz give me supar fast method for reading Large Xml File of 4MB to 10MB. i have used the following code but it is also slow for my Application. 1 st way-> FileStream sr=new FileStream ("C:\test.Xml",FileMode.Open); XmlTextRader rd=new XmlTextReader(sr); Whlie(rd.Read()) { // ----- // } Second way-> FileInfo sr=new FileInfo ("C:\Test.Xml"); XmlTextRader rd=new XmlTextReader(sr.OpenRead()); Whlie(rd.Read()) { // ----- // } Sanjit.rajbanshi@wlinktech.com

          D Offline
          D Offline
          DavidNohejl
          wrote on last edited by
          #4

          Well the super-fast method would be read them same way as plain text. Maybe XML is not good format for your application? If you want to, provide more details about that XML file and app...


          "Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups