0

I'm running out of ideas so checking if anybody can shed some light.

  • 2 tier Client-server application
  • SQL Server 2005
  • Workstation: Windows XP
  • Client-Server Application 1 uses SQL OLE DB Provider. (Provider=SQLOLEDB.1)
  • Client-Server Application 2 uses SQL Native Client. (System.Data.SqlClient.SqlConnection)

Somehow, application 1 works well but application 2 needs to have Timeout in connection setting to be 30 seconds to make it work.

Using a tip I learned from JohnnyCoder's Database Connectivity Test with UDL File, I tracked down the problem is somewhere around driver. When I try Microsoft OLE DB Provider for SQL Server, it connects immediately. When I try SQL Native Client, it doesn't take long. It fails even it I set connection timeout to be 60.

Both of the applications work well on other installations but not on one specific site. So it has to be related to some environmental settings such as security, firewall, etc.

I tried installing new SQL Server 2005 Native Client on workstation. No luck.

So my question is:

  1. Why does Application 2 ever make it work when the client actually cannot connect? Is there internal logic to use OLE DB when SQL Native Client timeout happens?
  2. What else would you take a look?
kennethc
  • 814
  • 1
  • 10
  • 26
  • Check your connection string here: http://connectionstrings.com/sql-server-2012#sql-server-native-client-11-0-oledb-provider. Verify that it is correct, or make the necessary changes to make it correct, and try connecting again. Add the connection string you are using to your question. Let us know the results. – Robert Harvey Mar 28 '13 at 19:11
  • Thank you for reply. My full OLE DB Provider connection string looks like this: "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;Password=password;Initial Catalog=database;Data Source=server\instance" My full SqlConnection string is exactly the same except Provider attribute, so "Persist Security Info=False;User ID=username;Password=password;Initial Catalog=database;Data Source=server\instance". Hope this clarifies what you wanted to know. – kennethc Mar 28 '13 at 19:16
  • To be more specific how it is used in the code: `var conn = new System.Data.SqlClient.SqlConnection(ConnectionString);` – kennethc Mar 28 '13 at 19:19

1 Answers1

2

Answer: their network firewall blocked TCP/IP packets. As a result, SQL Native Client timed out with TCP/IP after 20 seconds and then tried Named Pipe which made it work.

kennethc
  • 814
  • 1
  • 10
  • 26