最近在项目遇到一个很头疼的问题,asp.net网站发布以后,开始运行正常,但是过一段时间就不能访问,而且还要报错。错误代码如下: 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. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .er {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
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.]
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4863722
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   Fdays.DBUtility.MSSqlHelper.CreateSqlConn() +86
   Fdays.DBUtility.BaseHelper.GetDataSet(String strSql, String strTableName) +121
   Fdays.DBUtility.BaseHelper.GetDataSet(String strSql) +49
   Fdays.DBUtility.BaseHelper.GetDataTable(String strSql) +55
   Fdays.SqlServerDal.News.DNews.GetNewsList(MO_news mo_news, String strWhere, Int32 num) in F:\FdaysB2C\Fdays.VacationB2C\Fdays.SqlServerDal\News\DNews.cs:339
   Fdays.Bll.News.BNews.GetNewsList(MO_news mo_news, String strWhere, Int32 num) in F:\FdaysB2C\Fdays.VacationB2C\Fdays.Bll\News\BNews.cs:151
   Fdays.SiteBuild._Default.Page_Load(Object sender, EventArgs e) in F:\FdaysB2C\Fdays.VacationB2C\Fdays.WebApp\Default.aspx.cs:40
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   Fdays.SiteBuild.Public.Core.BasePage.OnLoad(EventArgs e) in F:\FdaysB2C\Fdays.VacationB2C\Fdays.WebApp\Public\Core\BasePage.cs:353
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627