1

I am working on a personal project and have implemented a database system using the Entity Framework code first tutorial on msdn, link below,

http://msdn.microsoft.com/en-gb/data/jj193542

I am running Visual Studio 2012 and the database has been created using Microsoft SQL Server and localdb. However i wish to run my application on any computer and this current setup will not allow me to do so.

I am a bit of a novice when it comes to databases, and would like some advice/resources that outline how i can change my database setup so that it is available on any computer and also retain the data currently in my database.

Any help would be greatly appreciated, Thanks in advance!

KingSpread
  • 13
  • 1
  • 3

2 Answers2

1

For LocalDB you'll need to install SQL Server Express on all the machines where you want to run your application. If you don't want to do that, have a look on SQL CE. That allows you to have only DB file moved about and all the required libraries can be included in your project.

Glorfindel
  • 2,205
  • 5
  • 19
  • 26
trailmax
  • 254
  • 1
  • 4
  • 14
1

When using SQL Server LocalDB, you can move the application to other pc's as much as you like, provided the SQL Server LocalDB functionality is installed. Check here for more info.
They provide a nice way to silently install it, so you can bundle it with the installer for your application:

msiexec /i SqlLocalDB.msi /qn IACCEPTSQLLOCALDBLICENSETERMS=YES

All you need to do then is copy the mdf and ldf files to a location of your choice and update the configuration file to use these files.

Glorfindel
  • 2,205
  • 5
  • 19
  • 26