我写了个程序,不过程序一旦运行了一段时间,就会出现以下问题,查来查去都不知道什么原因,请各位大哥帮忙看看,分不够可以再加!
Server Error in / Application.
--------------------------------------------------------------------------------
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
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.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[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.]
HHE.User.User.GetUserRight() +204
HHE._default.Page_Load(Object sender, EventArgs e) +476
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.510; ASP.NET Version:1.1.4322.510
你的连接池的连接已经达到最大数,造成创建新的连接超时
你看看是不是你的连接没有释放
what database are you using? how are you opening the database? show us the connection string? also try
objConnection.Dispose()
你最好把你的连接的模式说一说,有可能你的连接对象没有被释放
Connection没有正常关闭,导致数据库连接池达到最大数目.
参考帮助
ms-help://MS.VSCC/MS.MSDNVS.2052/cpguide/html/cpconconnectionpoolingforsqlservernetdataprovider.htm