Install LocalDB through the installation wizard or by using the SqlLocalDB. msi program. LocalDB is an option when installing SQL Server Express LocalDB. Select LocalDB on the Feature Selection/Shared Features page during installation.
In Visual Studio 2012 all I had to do was enter:
(localdb)\v11.0
Visual Studio 2015 and Visual Studio 2017 changed to:
(localdb)\MSSQLLocalDB
as the server name when adding a Microsoft SQL Server Data
source in:
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:
View/SQL Server Object Explorer.
OK, answering to my own question.
Steps to connect LocalDB to Visual Studio Server Explorer
SqlLocalDB.exe start v11.0
SqlLocalDB.exe info v11.0
(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 in :
Microsoft SQL Server (SqlClient)
(localdb)\MSSQLLocalDB
Use Windows Authentication
Press Refresh button to get the database name :)
Unlike the other answers, this approach uses:
- No special commands.
- No complicated configurations.
Just use the SQL Server Object Explorer
It's pretty straightforward...
{YourTableName}
table > View Designer
Done.
It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With