I have created an ASP.Net web application with SQL Server 2005 database on another computer.
I want to transfer it to another PC. Therefore, I have copied the ASP.Net Project and also the SQL database in .bak
format. I need to configure the application to connect to the database and need help to get the correct connection string.
PS: the database created was by SQL Server 2005 and I need to deploy on SQL Server 2012
bak files are Sql Server backup files. You need to restore it into the Sql Server 2012 and go from there.
Restoring database files in Sql Server 2012 -> http://msdn.microsoft.com/en-us/library/ms177429.aspx
And the connection string to connect you application to it -> http://connectionstrings.com/sql-server-2012
Links by "tucaz" are good examples to start with. You can also follow these steps to get an idea.
Create new database on SQL server 2012 on new PC
Right click newly created database and find Restore database option. Give .bak files needed to restore
Make sure to select "Overwrite the existing database (WITH REPLACE)" option in restore database file window
Once the backup is restored, the use the following format of the connection string on application config file.
You have to restore the database on new sql server 2012, then you can make a new connection string. If you leave the name the same, you only have to change the name of the server in the connection string.