title: Can't connect to sql server express through the network using c#
body: <p>I have SQL Server 2016 Express running on a network server. I can access SQL Server on the server and run queries. </p>
  
  <p>On the server:</p>
  
  <ul>
  <li>tcp/ip enabled, named pipes enabled and tcp ip address IPALL is listening on port 1433, tcp dynamic ports for this ip is blank</li>
  <li>SQL Server Browser is running</li>
  <li>Firewall 
  
  <ul>
  <li>Inbound Rules port 1433 is open and enabled</li>
  <li>Outbound Rules port 1433 is open and allow connections</li>
  </ul></li>
  <li>Server name is: <code>CLW2016S-1</code>, SQL Server instance is <code>SQLEXPRESS</code></li>
  <li>The server's IP4 address is 192.168.2.11</li>
  </ul>
  
  <p>This is an internal application and I am connecting as 'sa'. In my project I tried different connect strings, they all generate the same error when I try and create the connection</p>
  
  <pre><code>static string connStr = "Data Source=192.168.2.11\\SQLEXPRESS;Initial Catalog=myzpp;User ID=sa;Password=A$$#@123; ";
  
  static string connStr = "Data Source=\\\\CLW2016S-1\\SQLEXPRESS;Initial Catalog=myzpp;User ID=sa;Password=A$$#@123; ";
  
  static string connStr = "Data Source=192.168.2.11\\SQLEXPRESS,1433;Initial Catalog=myzpp;User ID=sa;Password=A$$#@123; ";
  
  static string connStr = "Data Source=192.168.2.11\\CLW2016S-1\\SQLEXPRESS;Initial Catalog=myzpp;User ID=sa;Password=A$$#@123; ";
  </code></pre>
  
  <p>They all generate the same error after this command</p>
  
  <pre><code>SqlConnection conn = new SqlConnection(connStr);
  </code></pre>
  
  <blockquote>
    <p>'conn.ServerVersion' threw an exception of type 'System.InvalidOperationException'</p>
  </blockquote>
  
  <p>It is probably some missing setup for network access on the server but I've been looking for it for 2 days.</p>
  
  <p>Help is appreciated.</p>