Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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!

share|improve this question

migrated from stackoverflow.com Apr 10 '13 at 0:30

This question came from our site for professional and enthusiast programmers.

    
Flagged to move to dba.StackExchange.com ... This isn't a bad thing, the reason simply being that you'll typically get a more comprehensive explanation as this is within their realm of focus. –  Love2Learn Apr 9 '13 at 17:28

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.