I'm writing a program in C# that will need to store a few Data Tables on the user's computer and load them back when he restarts the program: Up to about 10000 records consisting of text and integers. I don't want to use a CSV file, and I had some trouble with SQLite. Are there any other good options to try?
Why not just serialise the datatables directy to binary and save them to disk. Loading you would be as simple as desierlising to datatables again?
Are you going to load everything into memory and then do all the processing of data in memory? In that case using a database engine is overkill, a simple XML file would probably do.
SQL Express would work. You can use Linq to SQL and access your data easily.,
The Microsoft equivalent for SQLite is SQL Server Compact. It is free. You just need to redistribute some dlls with your application. The end user won't be forced to install a full fledged db product like SQL Server Express or MySQL to run your application.
Put your DataTables into a DataSet (if they aren't already) and use the DataSet's WriteXml
method to save the contents to an XML file, and ReadXml
to reconstitute your DataSet.
If your app is already written to work with DataTables (i.e. you use Sort, Select etc. directly on the DataTable), this is your easiest and simplest solution. The resulting XML file might be too large for your porpoises (since XML is pretty verbose), but probably not given the 10,000 rows.
Personally, I love SQLite (in conjunction with the open source .NET provider, System.Data.SQLite). I'm not sure what kind of issues you had with SQLite, but maybe changing to an easy to use provider will help.
Firebird work perfectly with dotNet and can be use for this too.