Visual Studio 2012 comes with a new small light-weight database named LocalDB\v11.0. You can find out the default database used by Visual Studio 2012 by checking out TOOLS >> Options… >> Database Tools >> Data Connections:
If you have a SQL2005 or SQL2008 database and wish to use it in a Visual Studio 2012 application, you should upgrade it to LocalDB\v11.0 format. Here’s what I did when I came across this predicament. I used the usual Northwind.mdf SQL2008 database for this post.
- In Visual Studio 2012 “Server Explorer”, right-click on “Data Connections” and select “Add Connections…”
- Click the “Change…” button on the “Add Connection” dialog:
- Choose “Microsoft SQL Server Database File” then click OK. You will be returned to the “Add Connection” dialog.
- Navigate to the location of your Northwind.mdf file by clicking the “Browse…” button, then click OK.
- Visual Studio 2012 will detect that the database is not of LocalDB\v11.0 format and will display this message:
- Click “Yes” so that your SQL200x database gets upgraded to LocalDB\v11.0. Upon completion of the upgrade process you will be able to view all your database objects in Server Explorer:
Hope this helps.
Post a Comment