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 --->

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 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. – hatchet - done with SOverflow Jul 16 '11 at 17:11
  • hmm i think it might be the query timing out. –  Jul 16 '11 at 17:13
  • See http://stackoverflow.com/questions/5567097/using-mysqlconnection-in-c-does-not-close-properly – sgmoore Jul 16 '11 at 17:29

1 Answers1

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131