.NET SQLClient Data Provider: Timeout expired

.NET SQLClient Data Provider: Timeout expired when running a ODBC connection from a Win7 to Win2008R2 SQL2008R2 DB.  Connection establishes on basic ODBC but continually times out.

What I have tried:
1) Adding "Connection Timeout=0" and "context connection=true" in ODBC string
2) Setting SQL connection to 0
3) Trying different ODBC connection types

sp and query runs fine on SQL with no issues, it just takes about 5 minutes to complete interpolation.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Melih SARICAOwnerCommented:
connection timeout is not about query execution.  its about query connection timeout..

If ur query returns data on SQL in 5 mins.. u ave to set the commandtimeout property of SQLcommand

check link


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nwentlandAuthor Commented:
I saw this link and it mentions "context connection=true" is set in the string this will null the code.
Melih SARICAOwnerCommented:
did u try setting thhe timeout value of ur SQLCommand that u ll execute ?
Context connetion or Connection Timeout is totally different. they are all about connection. UR problem is about query execution.
nwentlandAuthor Commented:
Sorry for being ignorant, but will this require a recompile of .NET?

using System;
using System.Data.SqlClient;
public class A {
   public static void Main() {
      string connectionString = "";
      using (SqlConnection connection = new SqlConnection(connectionString)) {
         SqlCommand command = new SqlCommand(queryString, connection);
         command.CommandTimeout = 3600;
         try {
         catch (SqlException e) {
            Console.WriteLine("Got expected SqlException due to command timeout ");
Melih SARICAOwnerCommented:
recompile of what ? Ur code ? probably yes u ll ave to recompile..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.