title: Problem connecting asp.net core app to SQL server in a docker container
body: <p>I have setup <code>asp.net core</code> applicaiton using <code>SQL Server Management Studio</code> on <code>Windows OS</code>, to be able to run same project on <code>Mac OS</code> I have setup <code>docker container</code> and running <code>SQL server</code> using <code>azure data studio</code> for management.</p>
  <p>However I have tried various ways, it's not connecting and I think problem is with connection string..</p>
  <p><strong>Connection String</strong></p>
  <pre><code>{
    &quot;ConnectionStrings&quot;: {
      //&quot;DefaultConnection&quot;: &quot;Data Source=localhost; Initial Catalog=BalDict; Integrated Security=false; MultipleActiveResultSets=True;&quot;,
  
      &quot;DefaultConnection&quot;: &quot;Server=localhost;Database=BalDict;user=sa;password=MySecurePass;MultipleActiveResultSets=true&quot;
  
    },
  </code></pre>
  <p><strong>I am getting following error</strong></p>
  <pre><code>SqlException: Cannot open database &quot;BalDict&quot; requested by the login. The login failed.
  Login failed for user 'sa'.
  </code></pre>
  <p><a href="https://i.stack.imgur.com/kuaNX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kuaNX.png" alt="enter image description here" /></a></p>