Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LocalDB not recognized in Visual Studio 2015

I'm trying to create a database-first ASP.NET MVC app with Entity Framework in Visual Studio.

Starting with a blank project template, I open up the Server Explorer and try to add a data connection. I use Microsoft SQL Server as the Data Source, and "(localdb)\v11.0" as the Server Name. This gives me the error:

"The Data Source value in the connection string specifies an instance of SQL server that is not installed. To resolve the issue, either choose to install the matching instance of SQL Server or modify the Data Source value in the connection string."

The tutorial I'm following (and a few other places I've googled) mentions that localdb is installed with Visual Studio. Either way, I have also installed LocalDB found here but it's not showing up.

I've tried following the directions in this post, but get the error "Cannot create an automatic instance."

How do I get Visual Studio to connect to LocalDB?

like image 560
jmk22 Avatar asked Oct 21 '15 23:10

jmk22


People also ask

Does Visual Studio install LocalDB?

Alternatively, you can install LocalDB through the Visual Studio Installer, as part of the Data Storage and Processing workload, the ASP.NET and web development workload, or as an individual component.


1 Answers

The default instance name is changed to (localdb)\MSSQLLocalDB independent of version numbers for VS 2015.

More info here: http://thebillwagner.com/Blog/Item/2015-02-05-VersionindependentlocalDBinVisualStudio2015

like image 69
Saravana Avatar answered Oct 09 '22 16:10

Saravana