I have developed an application in Visual Studio 2012 with a SQL Server 2012 database. When I try to publish the application to test it, it works correctly on my machine (that includes the database in a SQL Server data folder), but when I move that published app to another machine it doesn't work.
I want to know the simplest way to deploy the project together with its database. I have seen a solution to integrate the SQL database with my application is to use a localdb but I don't understand the steps to use it. I need all the steps to deploy an application with a SQL Server 2012 database in order to install the application on another PC without having to install SQL Server 2012 on that PC.
It seems not too long ago I faced the same problem. I looked at SQL Server, MySQL, SQL Server Express and SQL Server Compact edition. I wanted a simple database for a standalone application. SQL Server Compact fit the bill for a standalone, self-contained database. SQLite is another excellent choice for a standalone database, but that is another answer. SQL Server Express pros/cons is covered in another answer already.
To deploy SQL Server Compact (CE) you would could either include the installer of
SQLCE40Runtime_x86-ENU.exe
or you include the needed directories and Dlls manually that the installer creates for you. For more deployment information see: https://msdn.microsoft.com/en-us/library/aa983326%28v=vs.140%29.aspxThe connection string I would use is
For additional ideas for a connection string see: http://www.connectionstrings.com/
Any choice you ultimate make, there are pros and cons to each choice that you will have to make. Either way it will require you to do some research to choose the best choice for your application. Don't be intimidated. Once you research it further, it is not as hard as you might think initially. It is simply a learning curve that everyone has to go through.