just open cmd and type
SqlLocalDB.exe start MSSQLLocalDB
Decision
In Visual Studio 2012 all I had to do was enter:
1 2 |
(localdb)\v11.0 |
or Visual Studio 2015 changed to:
1 2 |
(localdb)\MSSQLLocalDB |
as the server name when adding a Microsoft SQL Server Data
source in:
1 2 |
View/Server Explorer/(Right click) Data Connections/Add Connection |
and then the database names were populated. I didn’t need to do all the other steps in the accepted answer, although it would be nice if the server name was available automatically in the server name combo box.
You can also browse the LocalDB database names available on your machine using:
1 |
View/SQL Server Object Explorer. |
Also…
SqlLocalDB.exe info MSSQLLocalDB
pause
Another Decision
Steps to connect LocalDB to Visual Studio Server Explorer
- Open command prompt
- Run
SqlLocalDB.exe start v11.0
- Run
SqlLocalDB.exe info v11.0
- Copy the Instance pipe name that starts with np:\…
- In Visual Studio select TOOLS > Connect to Database…
- For Server Name enter
(localdb)\v11.0
. If it didn’t work, use the Instance pipe name that you copied earlier. You can also use this to connect with SQL Management Studio. - Select the database on next dropdown list
- Click OK