1

What I have going on is a basic update query, that updates based on a unique id, and below is my connection string.

    public static string masterConString = "SERVER=192.168.0.12;" +
                                           "UID=;" +
                                           "PASSWORD=;" +
                                           "connectiontimeout = 240000;";

UID and password are correct.

However, I cannot figure out why I'm getting random connection timeout issues. I have about 8 open connections to the server.

System.TimeoutException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connect host failed to respond --->

3
  • is opening a connection timing out, or is a query timing out? The connectionTimeout setting ONLY applies to obtaining a connection. Once a connection is open, setting timeout for queries etc within that connection is done differently. Commented Jul 16, 2011 at 17:11
  • hmm i think it might be the query timing out. Commented Jul 16, 2011 at 17:13
  • See stackoverflow.com/questions/5567097/… Commented Jul 16, 2011 at 17:29

1 Answer 1

1

The connection string timeout ONLY applies to opening the connection. Once the connection is open, you set the timeout for operations within that connection separately. For example, if you are using LINQ to SQL, the DataContext class has a CommandTimeout property for setting this. In the case of DataContext, the default is 30 seconds.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.