How to add portable database to MVC application?

Currently, I have an ASP.NET MVC 3 project, as well as a class library project, which I plan to open source. Before I do this, although I want to clean the project a bit. One modification I want to do is the database. The site is currently published on a shared hosting server, and I am setting up an SQL database on this server. However, since people will deploy the project and run it locally, I would just like to attach the SQL Server express database or something that is part of the project. I want people to clone the repository, open a project, press F5 and run it. Currently, they will have to tune the SQL database and create all the tables and stuff.

The solution consists of two projects: MvcUI and Domain. A domain is a place where all the application logic takes place. In fact, the domain is an agnostic UI, which means that it could be used by a desktop application as easily as it could be with a web application.

I would like the database to be part of the Domain (class library) project. I have never done this before. If anyone could give a simple explanation of how I would need to configure this, I would be delighted. It would be very nice to have a database only in the solution, because I could pre-populate it with some basic data. What do I need to do to get this database in my project as a database file, and what not?

+5
source share
1 answer

SQL Server Compact Edition - SQL, , .

Microsoft SQL Server Compact 4.0 - , - ASP.NET Windows . SQL Server Compact 4.0 , Visual Studio WebMatrix, SQL Server.

+5

All Articles