title: Error connecting to SQL Server 2005 with ADO.NET 4
body: <p>I am trying to connect to our sql server with the following connection string</p>
  
  <pre><code>&lt;add name="siteDB" connectionString="Data Source=xxxxx\sql_2005;Initial Catalog=Intranet;User ID=username;Password=password" providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <p>but I am getting this error</p>
  
  <pre><code>A connection was successfully established with the server, but then an error occurred during the pre-login handshake
  </code></pre>
  
  <p>this is only a problem when the Web app is compiled as .net 4, .net 2 seems to work fine</p>
  
  <p>I have tried the following with no success</p>
  
  <pre><code>TrustServerCertificate=True
  </code></pre>
  
  <p>in the connection string.. no joy</p>
  
  <p>also tried</p>
  
  <pre><code>TCP/IP protocols enabled
  named pipes enabled
  </code></pre>
  
  <p>using a newly set up account with the correct permissions</p>
  
  <p>any ideas?</p>
  
  <p>thanks </p>
  
  <p>nat</p>