Large XML File
-
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:
Have you tried loading the Xml file into a
DataSet
and assigning it to your grid'sDataSource
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 -
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:
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
-
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
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 :)
-
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 :)
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 -
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: