Shaggydog
Shaggydog

Reputation: 3788

Easiest way to set up a file based database with Entity Framework

I'm developing an application, in part to learn new technologies - in this instance Entity Framework. I'm using .NET 4.5, Visual Studio 2013. I need some way to store data that doesn't involve running an SQL server on my tired old laptop (not even the lightweight one) and works with Entity Framework. Ideally I would like something that just stores data in a file. I have a few basic requirements:

I've spent the better part of today trying to get VS2013 to connect me to an SQLite database that I've created. I never got anywhere. SQLite is simply not listed among the available types of data sources. I've read StackOverflow posts about this issue, I'm done trying to make it work. (this is where the frustration you can sense in this post stems from - this is SO not the point of the exercise, yet I've wasted so much time with it) Is there any other file based database technology I could use?

Upvotes: 6

Views: 7906

Answers (2)

ErikEJ
ErikEJ

Reputation: 41759

I suggest you use SQL Server Compact in combination with my free SQL Server Compact Toolbox VS extension:

A simple relational database. Max 10 tables, this is a prototype, so the tables won't get very big

  • SQL CE supports all standard relational paradigms, and has a max database size of 4 GB

Ability to design the database in some sort of GUI tool

  • The extension allows you to do this in Visual Studio

Ability to generate Entity Framework database model from the DB. I don't want to type those in manually.

  • Yes, fully supported

No proprietary software other than what I'm already using - i.e. I don't own a MS Access license

  • SQL Compact is free and freely distributable

Upvotes: 2

Mojtaba Tajik
Mojtaba Tajik

Reputation: 1733

Your needs are not compatible, the best choice is SQLite but you can not generate model from database and must use EF as CodeFirst .

and your problem with SQLite can easily fixed by using correct provider and configuration : http://www.bricelam.net/2012/10/entity-framework-on-sqlite.html

Upvotes: 2

Related Questions