Find connection string for DB in Rider/Azure Data Studio. SQL
Asked Answered
E

1

5

I created server through docker with command:

docker run -d — name MySQLServer -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=your_password123’ -p 1433:1433 mcr.microsoft.com/azure-sql-edge

I'm working on an M1 Mac, and everything works fine. I created test DB and tables. Studio for visualization of my server I use Rider or Azure Data Studio. Both of them are friendly using but I can't get connection string for my DB from both of them. I need it for appSettings in my .NET project. How I can find it? In Visual Studio I found it in properties of DB. Here I don't see such option.

Eldreda answered 1/1, 2022 at 18:18 Comment(0)
G
16

I am also using M1 Mac and SQL Edge coming from this tutorial. In the ASP.NET WebApp the connection string looks something like this:

      "ConnectionStrings": {
          "Default": "Server=localhost; Database=<insert db name>; User Id=sa; Password=your_password123"
      }
Gent answered 3/1, 2022 at 11:13 Comment(1)
If you are getting this error with the previous connection string: System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback. It is because by default Encrypt is set to True, so you will need to add this to the connection string: Encrypt=False or TrustServerCertificate=true. For more information visit this issueJaysonjaywalk

© 2022 - 2025 — McMap. All rights reserved.