title: When running Docker: Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started
body: <p>I am trying to deploy my REST API .NET Core app with Docker for the first time, however, after creating my docker image, when I try to run:</p>
  <p><code>docker run -p 8080:80 mydockerid/dockerapi</code></p>
  <p>I get a big call stack among which there's the error:</p>
  <pre><code>fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
        An error occurred using the connection to database 'CommanderDB' on server 'HELLO\SQLEXPRESS'.
  fail: Microsoft.EntityFrameworkCore.Query[10100]
        An exception occurred while iterating over the results of a query for context type 'Commander.Data.CommanderContext'.
        System.Exception: Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started.
         ---&gt; System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known
           at System.Net.Dns.InternalGetHostByName(String hostName)
           at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
           at System.Net.Sockets.UdpClient.BeginSend(Byte[] datagram, Int32 bytes, String hostname, Int32 port, AsyncCallback requestCallback, Object state)
           at System.Net.Sockets.UdpClient.&lt;&gt;c.&lt;SendAsync&gt;b__56_0(Tuple`2 targetPackedArguments, Int32 targetBytes, Int32 targetPort, AsyncCallback callback, Object 
  state)
  </code></pre>
  <p>After some research, I think the problem might be the 'Server Name' of my SQL Server Express. When I login on SQL Server Management Studio, I use 'HELLO\SQLEXPRESS' as the server name:</p>
  <p><a href="https://i.stack.imgur.com/L5z5E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L5z5E.png" alt="enter image description here" /></a></p>
  <p>Here is my connection string in appsettings.json:</p>
  <p><code>&quot;CommanderConnection&quot;: &quot;Server=HELLO\\SQLEXPRESS;Initial Catalog=CommanderAPI;User ID=myid;Password=mypassword;&quot;</code></p>
  <p>Should my server name be something else? Perhaps there's a way to change the server name to an actual IP address?</p>
  <p>Thanks in advance.</p>