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. XML / XSL
  4. Large XML File

Large XML File

Scheduled Pinned Locked Moved XML / XSL
csharpwinformsxmlhelpquestion
6 Posts 4 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.
  • C Offline
    C Offline
    Clickok
    wrote on last edited by
    #1

    I have a XML File with 32000 records, about 5Mb size. :omg: How I do to load this (very fast) in Windows Forms DataGrid? :confused: In help of .Net SDK says what I need use a XMLTextReader, but it is slow for me... :doh: Thanks for all :laugh:

    I R S 3 Replies Last reply
    0
    • C Clickok

      I have a XML File with 32000 records, about 5Mb size. :omg: How I do to load this (very fast) in Windows Forms DataGrid? :confused: In help of .Net SDK says what I need use a XMLTextReader, but it is slow for me... :doh: Thanks for all :laugh:

      I Offline
      I Offline
      ian mariano
      wrote on last edited by
      #2

      Have you tried loading the Xml file into a DataSet and assigning it to your grid's DataSource property?

      DataSet   ds = new DataSet();
      ds.ReadXml(<>);
      grid.DataSource = ds;
      

      Ian Mariano - http://www.ian-space.com/
      "We are all wave equations in the information matrix of the universe" - me

      1 Reply Last reply
      0
      • C Clickok

        I have a XML File with 32000 records, about 5Mb size. :omg: How I do to load this (very fast) in Windows Forms DataGrid? :confused: In help of .Net SDK says what I need use a XMLTextReader, but it is slow for me... :doh: Thanks for all :laugh:

        R Offline
        R Offline
        Rebreath
        wrote on last edited by
        #3

        What exactly are you wanting to do with this huge XML file? Try loading it into a dataset before loading it into the DataGrid. Matthew R. Sannes Docsoft Technical Marketing Specialist www.docsoft.com msannes@docsoft.com

        C 1 Reply Last reply
        0
        • R Rebreath

          What exactly are you wanting to do with this huge XML file? Try loading it into a dataset before loading it into the DataGrid. Matthew R. Sannes Docsoft Technical Marketing Specialist www.docsoft.com msannes@docsoft.com

          C Offline
          C Offline
          Clickok
          wrote on last edited by
          #4

          Well... My ISP gives 150 MB space to files and 10 MB of Database (MSDE). I have a "Holy Bible" database, what haves 6 MB... How this database is read-only, I think what I can store it in a XML file and load-it when necessary... But this is very slow!!! Any sugestion? Thank you very much for your attention :)

          I 1 Reply Last reply
          0
          • C Clickok

            Well... My ISP gives 150 MB space to files and 10 MB of Database (MSDE). I have a "Holy Bible" database, what haves 6 MB... How this database is read-only, I think what I can store it in a XML file and load-it when necessary... But this is very slow!!! Any sugestion? Thank you very much for your attention :)

            I Offline
            I Offline
            ian mariano
            wrote on last edited by
            #5

            If it's read only, load it into a global application DataSet in the web application startup, that way it'll be around across multiple sessions without the hit from loading a 6MB XML file every time you need to access the "database." You only load it once, when the application starts...

            //   C#, in global.asax code-behind file
            protected void   Application_Start(Object sender, EventArgs e)
            {
               //   load the xml file into the app state
               DataSet   ds = new DataSet();
            
               ds.Load(Server.MapPath("./db.xml"));   //   map URL to local file
            
               Application.Contents.Add("db") = ds;   //   store in HTTP app state
            }
            

            To get it back, say to load up in a method in aspx code-behind page:

            DataSet   ds = (DataSet)Application.Contents["db"];
            

            Ian Mariano - http://www.ian-space.com/
            "We are all wave equations in the information matrix of the universe" - me

            1 Reply Last reply
            0
            • C Clickok

              I have a XML File with 32000 records, about 5Mb size. :omg: How I do to load this (very fast) in Windows Forms DataGrid? :confused: In help of .Net SDK says what I need use a XMLTextReader, but it is slow for me... :doh: Thanks for all :laugh:

              S Offline
              S Offline
              ssm1226
              wrote on last edited by
              #6

              use XmlReader

              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