Read whole file into memory or just parts that are needed?
-
I am working on a personal money manager in C# and am wondering what I should do with regard to data. I have some code that I am starting with and currently it uses an XML file to store it's data. The data is then read into memory, uncompressed and then manipulated as required. Since this single file potentially could contain several Bank accounts, Stock accounts, etc, it could get large. However, probably not more than 5 meg. Should I read the entire file into memory even though I may not be using all the data? I am also considering using an SQL database rather than an XML file. Is an SQL database a better approach than a DataSet with regard to this type of application? What is the general consensus on using DataSets (i.e., should they only be used for files that are expected to be small in size)? If so, roughly what should that size be?
-
I am working on a personal money manager in C# and am wondering what I should do with regard to data. I have some code that I am starting with and currently it uses an XML file to store it's data. The data is then read into memory, uncompressed and then manipulated as required. Since this single file potentially could contain several Bank accounts, Stock accounts, etc, it could get large. However, probably not more than 5 meg. Should I read the entire file into memory even though I may not be using all the data? I am also considering using an SQL database rather than an XML file. Is an SQL database a better approach than a DataSet with regard to this type of application? What is the general consensus on using DataSets (i.e., should they only be used for files that are expected to be small in size)? If so, roughly what should that size be?
SQL might be a good option and Microsoft has a new SQL Server that would work well for this.... http://www.microsoft.com/sql/editions/sqlmobile/default.mspx It is not just for mobile devices it runs on desktops now too. I started to look at it and it is not what I need for work, but I am debating using it for a personal project.
Steve Maier, MCSD MCAD MCTS
-
SQL might be a good option and Microsoft has a new SQL Server that would work well for this.... http://www.microsoft.com/sql/editions/sqlmobile/default.mspx It is not just for mobile devices it runs on desktops now too. I started to look at it and it is not what I need for work, but I am debating using it for a personal project.
Steve Maier, MCSD MCAD MCTS
Thanks for the reply. I already know of this and several others. If I use an SQL database, I'm not sure which one I will go with, but I may use the "Minosse" DBMS or "Sharp HSQL" as the source code is available for both.
-
Thanks for the reply. I already know of this and several others. If I use an SQL database, I'm not sure which one I will go with, but I may use the "Minosse" DBMS or "Sharp HSQL" as the source code is available for both.
That reminds me of when I worked at writing printer drivers. The group that wrote the code that ran on the machine and scheduled things and rendered the pages and the UI for it was all in Java. I asked why use Java and their biggest selling point was that it was portable. So I asked if they were planning to port it to a different platform and they reply that it would never happen because there were kernal changes on Solaris that they put in to make things run and that the guy that did them is no longer working with the company. So they decided to use a nice portable language on a system where porting was not even feasible. Having the source code to the database really does not do anything for you unless you are going to put in your own things to it - and most people won't. If you are working on something to try to sell to others, there is alot more things to do with website, marketing, support, as well as the programming. Having the source code for the database would just be one more thing that I would be looking at and tweaking and delaying the release of the product..... but on just something that is for your own use it could be fun to look over how they are doing the database and what is behind it. Good Luck. As for some of the many free databases that are out there, I have played around with a few and some of them did not have very good ADO.NET providers at the time. They keep getting better but it's something to watch out for.
Steve Maier, MCSD MCAD MCTS