С#. LocalDB adventure


just open cmd and type

SqlLocalDB.exe start MSSQLLocalDB



What is localDB?



In Visual Studio 2012 all I had to do was enter:

or Visual Studio 2015 changed to:

as the server name when adding a Microsoft SQL Server Data source in:

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:

SqlLocalDB.exe info MSSQLLocalDB


Another Decision

Steps to connect LocalDB to Visual Studio Server Explorer

  1. Open command prompt
  2. Run SqlLocalDB.exe start v11.0
  3. Run SqlLocalDB.exe info v11.0
  4. Copy the Instance pipe name that starts with np:\…
  5. In Visual Studio select TOOLS > Connect to Database…
  6. 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.
  7. Select the database on next dropdown list
  8. Click OK

enter image description here

This entry was posted in C#. Bookmark the permalink.