LocalDB connection string to v14 SQL

0

I created a DB like this:

C:\Users\user>sqllocaldb create demo
LocalDB instance "demo" created with version 14.0.1000.169.

C:\Users\user>sqllocaldb info demo
Name:               demo
Version:            14.0.1000.169
Shared name:
Owner:              PC\user
Auto-create:        No
State:              Running
Last start time:    13/03/2020 11:11:43
Instance pipe name:

C:\Users\user>

I Can connect to it with SQL Server 2017 Management studio using

(LocalDB)\demo
Windows Authentication

But I'm failing to create a connection string that can be used locally from within EF Core.

Some of my failed attempts:

"Data Source=(LocalDB)/demo;Initial Catalog=Catalog1;Integrated Security=True;"
"Data Source=(LocalDB)\demo;Initial Catalog=Catalog1;Integrated Security=True;"
"Data Source=.;Initial Catalog=(LocalDB)/demo;Integrated Security=True;"
"Data Source=.;Initial Catalog=(LocalDB)\demo;Integrated Security=True;"
"Data Source=.;Initial Catalog=demo;Integrated Security=True;"
"Data Source=.;Initial Catalog=demo;Integrated Security=True;"

This is always the error I get:

System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

System.ComponentModel.Win32Exception (53): The network path was not found

The instance is started, and SSMS can connect to it seamlessly, I think the only problem is that I don't know how to write the connection string properly

Attempt 2

Connections strings

"Server=(localdb)\\mssqllocaldb;Database=demo;Trusted_Connection=True;"

Tryied to add a user and use its credentials

CREATE LOGIN DEMO WITH PASSWORD = 'DEMO';
create user demoUser for login DEMO

And then tried to authenticate

"Server=(localdb)\\mssqllocaldb;Database=demo;Trusted_Connection=True;User Id=demoUser;Password=DEMO"
sql-server
entity-framework
ssms
asked on Stack Overflow Mar 13, 2020 by UberFace • edited Mar 13, 2020 by UberFace

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0