Connect timeout with System.Data.SqlClient .Net provider

I've got some long running data profiling queries that I am running against a SQL Server 2008 DB.

Here is the connection string that I am using with the .NET System.Data.SQLClient provider.

Data Source=myserver\development;Initial Catalog=mycatalog;Integrated Security=SSPI;MultipleActiveResultSets=True;Connection Timeout=3600

There are about 599 tables that are profiles. When I run this it gets through about 50-200 tables before timing out.

I've tried a) no connection timeout, b) connection timeout=0 and c)connection timeout=3600.

All three produce the same results: timeout!

Clearly, I am doing something wrong. But what? Thanks.

2 answers

I'm actually not an expert on this but i have the same issue on timeouts when doing queries but its using .Net app and utilizes table adapters etc... What i did is to extend the CommandTimeout property programmatically instead of ConnectionTimeout property. What you can check if there is like a CommandTimeout that you can set on the Profiler.

I think you have got the answer. The queries are actually being run in a .NET application. After being convinced that I did not have a sufficient "working knowledge of ODBC" and proving to the developer that changes to the Connection Timeout connection property did absolutely nothing, I got a new .exe which ran properly. Said developer must have tweaked the Command Timeout property as you mention.

Thanks.