I have a large amount of data stored in an xml file 173MB (4.6 million lines) that I have stored in my winforms working directory.it is the result of writing a datatable to an XML file. The datatable was originaly populated from a query to a SQL server.
The reason that I have it stored locally rather than requesting it from the server is that the data request took upwards of 40 seconds and at times timed out and the data is static and will never change, moreover the user can be off line and still use the data.
Loading the file backinto the datatable takes 20-30 seconds..I am not too woried about the time that it took to load from disk as I let the user know that data is loading and to be patient. However I don't like the XML file format and I am looking for other ideas for diskstorage.
The datatable is only beng used as a middleman for the eventual population of a collection object. If you have sugestions I would like to hear them. Thanks
I am hoping to stay away from a database solution and lean towards a binary file approach, below is my first attempt but I get an out of memory exception:
byte[] b = null;
using (MemoryStream stream = new MemoryStream())
{
BinaryFormatter bformatter = new BinaryFormatter();
bformatter.Serialize(stream, timeData);
b = stream.ToArray();
}
using (FileStream fileStream = new
FileStream("brad.bin", FileMode.Create, FileAccess.Write))
{
fileStream.Write(b, 0, b.Length);
}