title: Unable to access database on different subnet from IIS application
body: <p>I have a web server in a DMZ on a different VLAN and subnet than the trusted network. This web server must communicate with a database server on the trusted network, so the appropriate firewall rules have been applied. I am able to connect to the database from the web server using powershell and by using the ODBC Data Source Administrator snapin. However, running an IIS application throws the following error:</p>
  
  <p><em>A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Inner Exception: 
  Source: .Net SqlClient Data Provider</em></p>
  
  <p>I am using the same connection string in the web.config file of the IIS application as the one I use in powershell, which connects without any issue. Here is the connection string from the web.config:</p>
  
  <pre><code>"Data Source=192.168.1.xxx\SQLExpress;Database=mydb;uid=myuserid;password=mypassword;integrated security=false;" 
  </code></pre>
  
  <p>The only difference in the powershell connection string is that I do not specify the provider. If I leave that out of the web.config there is no difference.</p>
  
  <p>I have even disabled all firewalls on both servers for test purposes, but still get the same error.</p>
  
  <p>As ping and tracert from the web server to the database server complete successfully and I am able to connect via powershell and ODBC Data Source Administrator, I have no idea why the IIS application cannot connect.</p>