Entity Framework Connection to localDb Entity Framework Connection to localDb sql-server sql-server

Entity Framework Connection to localDb


You could try this

  1. In server explorer, right click, Choose Add Connection
  2. enter (localdb)\v11.0 in as the server name
  3. Choose your database and press connect
  4. Right click properties on your new connection
  5. Use that connection in string in your default connection

I.e.

<add name="DefaultConnection" connectionString="<Paste-connection-string-here>" providerName="System.Data.SqlClient" />

If that doesn't work, lets try starting it from the command line

  1. Open command prompt
  2. Run SqlLocalDB.exe start v11.0

Follow original steps , use the named pipe as your server name


If that doesn't work, lets try and connect via named pipes

  1. Open command prompt
  2. Run SqlLocalDB.exe info v11.0
  3. Copy the Instance pipe name that starts with np:...

Follow original steps , use the named pipe as your server name

e.g

enter image description here


Run this command to make sure what is the version of your LocalDBsqllocaldb infosqllocaldb info command result

So in my case the version is MSSQLLocalDB then the connection string will look like this

<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=IdentityManagerDB;Integrated Security=True"providerName="System.Data.SqlClient" />


To add on to TheGeneral use view - SQL Server Object Viewer and look immediately under the "SQL Server" object. You'll see the name of the connect looking something like "(localDB)\ProjectsV13" Hand enter that into the connection box then you can browse the server for the database you want to use.