title: Desktop application cannot connect to database but web application can
body: <p>I have written a C# desktop (winforms) application which is essentially a clone of a web application I wrote. The web application is able to talk back and forth with the database just fine. However, when I install the desktop application, I get the following error:</p>
  
  <p><em>A network-related or instance-specific error occurred while establishing a connection to SQL Server</em></p>
  
  <p>I am using the exact same connection string in the desktop application as I am using in the web app which looks like this:</p>
  
  <pre><code>"Data Source=tcp:s08.winhost.com;Initial Catalog=THEDATABASE;
              User ID=USERNAME;Password=******;Integrated Security=False;"
  </code></pre>
  
  <p>I am unable to use SQL Server Configuration Manager as my databases are hosted on Winhost.com. However they have made it clear to me that the proper ports are open, named pipes are on and SQL Browser is configured correctly. If anyone has had a similar problem, please let me know what you did to resolve this issue. I have also included the entire error below.</p>
  
  <p>Thanks</p>
  
  <p><code>************** Exception Text **************</code><br>
  <code>System.Data.SqlClient.SqlException (0x80131904): 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) ---&gt; System.ComponentModel.Win32Exception (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond</code></p>