user1612992
user1612992

Reputation: 35

SQLite in VS 2012

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)

  1. Ditch Entity and access SQLite directly through commands.
  2. Use Entity with SQLite (Would appreciate link on proper way to create databases at runtime tho)
  3. Ditch the whole concept of database (I put this one in because, before, every book had a chapter on databases, now I don't have a single book that mention it. Also not much new stuff on Internet either, so people might moved on to some other concept)

Thanks.

Upvotes: 0

Views: 1057

Answers (3)

Achilles
Achilles

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

paparazzo
paparazzo

Reputation: 45096

Sound like structured textual data - dozen or so string properties.

I would use XML

XDocument Class

Upvotes: 1

Derek
Derek

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

Related Questions