Reputation: 35
Ok, spent too much time banging my head with this :)
I need to persist small (under 1000) collection of items between sessions on windows without using full database server. Items are simple objects with dozen or so string properties. Database/collection/whatever should be stored in a single file that can be created through code in runtime.
Started with SQL server CE then switched to SQLite but now I'm told Entity is a way to go. I don't mind learning Entity, but seems like too much of an overhead for a simple storage.
What should I do? (if anyone still actually codes windows small databases)
Thanks.
Upvotes: 0
Views: 1057
Reputation: 1734
Actually I'm somehow going the same path as you are [VS2012/WPF4] and I found the combination of Dapper+Sqlite works fine for me.
The System.Data.SQLite
's design-time support won't be ready before November 2012 and therefore EF5 will be removed from my options.
Check Dapper out:
http://code.google.com/p/dapper-dot-net/
This extends IDbConnection
and you only need to open a connection to whatever database you want.
EDIT: using Dapper, I was unable to automate the data-binding...
Upvotes: 0
Reputation: 45096
Sound like structured textual data - dozen or so string properties.
I would use XML
Upvotes: 1
Reputation: 8630
I would use a Data Context with SQL CE, its more than up to the job your describing.
The only problem is that you would only be able to back it up on your local C: Drive. So if that Disk ever died you would lose it all.
There's no need to move over to entity for what you need to do.
If it ever did become something that you would like multiple access to, you would have to re-think this one though.
Hope this Helps.
Upvotes: 0