I am trying to construct a connection string to a 2008 SQL Express database file in VS 2012. I am getting an error dialog:
This database file is not compatible with the current instance of SQL
Server. To resolve this issue, you must upgrade the database file by
creating a new data connection, or you must modify the existing
connection to this database file. For more information, see
From my experience of a few instants ago:
Forget about trying to open the old
SQL Server Express
.mdf file in Visual Studio 2012. During the conversion process of an old VS 2010 solution to VS 2012 it tells you can do that by just double clicking the database file and upgrade it to use LocalDb instead. That's a complete lie! :D
Open SQL Server Management Studio, select the
Databases node, right click it and select
Provide the path for the
.mdf file, click OK and then you should be good to go.
Visual Studio 2012, open
Server Explorer (menu
View -> Server Explorer), right click
Data Connections and then select
Add Connection.... In
Server name: put
(localdb)\v11.0 and in
Connect to a database: select the database you attached previously.
Right click the
Data Connection just added in
Solution Explorer and select
Properties. Copy the
Connection String property and replace the
App.Config one with this value.
SQL Server Management Studio I got an error while trying to attach an old
.mdf file I got from this sample project from DayPilot: Scheduler for ASP.NET MVC 4 Razor (C#, VB.NET, SQL Server). It was related to a path issue regarding the
.log file that accompanies the
.mdf database file. I just selected the
.log file entry in the
Attach... dialog window and removed it. Then tried to attach the database again and it worked.