Connection Pool Timeout Issues

Posted on 2012-09-14
Last Modified: 2012-09-17
Hey guys,

I'm having some trouble with an ASP.NET app and my programmer is on vacation.  Yay!

I've got the app running on a number of different servers without issue but this specific instance is on a very locked down Windows 2008 Server Standard edition VM.  I have been granted local admin rights and I have a Windows SQL Server 2008 Enterprise R2 installation (which I upgraded from SQL Server 2008 Enterprise).  I can access the database from SSMS and query data in the tables logged in as SA so everything seems to be working correctly as far as that goes but I'm having trouble from the application.

My connection string is as follows:
connectionString="Data Source=localhost\MSSQLSERVER;Initial Catalog=MYDB;Connection Timeout=0;Persist Security Info=True;User ID=sa;Password=mypassword"

I'm getting the following error with the default configuration (which is working on my other servers):

"Timeout expired. The timeout period elapsed prior to connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."

The Exception Details:
"System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."  

The Source Error comes from a line in the .vb file of the page I'm trying to load.  The specific line that's highlighted is:

I think that's getting values from the database to populate a dropdown list box (not positive - again programmer is on vacation).  

Any ideas what I should be looking at?  

Question by:ttist25
    LVL 16

    Accepted Solution

    can you try to update the connection string with timeout value and alos with pool size like below?

    connectionString="Data Source=localhost\MSSQLSERVER;Initial Catalog=MYDB;Persist Security Info=True;User ID=sa;Password=mypassword;pooling='true'; Max Pool Size=1000; Connection Timeout=10"

    Try with this connection string and test once.
    LVL 19

    Assisted Solution

    by:Manoj Patil
    I also had the same problem about connection pool... So I follow the instructions given in below link. And after that this error didn't came again....

    For more details check this
    LVL 1

    Author Closing Comment

    Thanks guys.  

    I made the connection string changes recommended by srosebabu and ended up with a new error (error:25 invalid connection string).  When I researched that error I found that someone was able to fix it by removing the default instance name from the connection string.  I did that and it fixed it.  

    I have since changed the connection string back to the original settings except that I have left the instance name out and it still seems to be working.  I don't really understand why it's not giving me the timeout waiting for a connection from the pool but, it is working.  

    Thanks again for your help.  I'll update this if I run into issues again.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now