0

I have setup asp.net core applicaiton using SQL Server Management Studio on Windows OS, to be able to run same project on Mac OS I have setup docker container and running SQL server using azure data studio for management.

However I have tried various ways, it's not connecting and I think problem is with connection string..

Connection String

{
  "ConnectionStrings": {
    //"DefaultConnection": "Data Source=localhost; Initial Catalog=BalDict; Integrated Security=false; MultipleActiveResultSets=True;",

    "DefaultConnection": "Server=localhost;Database=BalDict;user=sa;password=MySecurePass;MultipleActiveResultSets=true"

  },

I am getting following error

SqlException: Cannot open database "BalDict" requested by the login. The login failed.
Login failed for user 'sa'.

enter image description here

Amir Dora.
  • 2,831
  • 4
  • 40
  • 61
  • 1
    Just to certify. The second string seems the one you want, but it's commented. Did you notice this? – Alexander Santos Oct 15 '21 at 22:06
  • Is this database "BalDict" acessible on Azure DataStudio? – Alexander Santos Oct 15 '21 at 22:21
  • yes it's already connected in Azure DataStudio. – Amir Dora. Oct 15 '21 at 22:22
  • You mean due to the image? I mean, your Azure DataStudio is connecting at an "default" database (Based on what is said on "Recent" tab). If your user can connect to the server, but cannot access the database "BalDict", it will succeed in Azure DataStudio – Alexander Santos Oct 15 '21 at 22:26
  • Thanks.. Its working now. After checking again i realized while I re-download docker image and deleting old one, It deleted the database along with it. Just recreated the database and connection is working. Thanks for you time. – Amir Dora. Oct 15 '21 at 23:16

0 Answers0