C# 为什么数据库会超时?

C# 为什么数据库会超时?,c#,sql,sql-server,C#,Sql,Sql Server,当我对数据库运行查询时,我不断地得到这些信息 System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Generated: Tue, 18 Aug 2009 08:05:39 GMT System.Web.HttpUnhandledException:

当我对数据库运行查询时,我不断地得到这些信息

System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Generated: Tue, 18 Aug 2009 08:05:39 GMT

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
   at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
   at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
   at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at System.Data.Linq.Provider.BindingList.Create[T](DataContext context, IEnumerable`1 sequence)
   at System.Data.Linq.DataQuery`1.GetNewBindingList()
   at System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList()
   at System.Windows.Forms.CurrencyManager.SetDataSource(Object dataSource)
   at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
   at System.Windows.Forms.BindingContext.get_Item(Object dataSource)
   at PlexityHide.GTP.TimeItemDataConnect.Wire()
   at PlexityHide.GTP.TimeItemDataConnect.UpdateDataSource(IListSource aDataSource, String aDataMember, Layer aLayer)
   at PlexityHide.GTP.TimeItemDataConnect.set_DataSource(Object value)
   at PlexityHide.GTP.Layer.set_DataSource(Object value)
   at WebSchedule._Default.Grid_OnEachListItemWhenDataBound_GridNode(Object GTPComponent, EachListItemWhenDataBoundArgs e) in C:\MyDev\WebSchedule\Schedule.aspx.cs:line 503
   at PlexityHide.GTP.Grid.NodeChangedInDS(GridNode aNode)
   at PlexityHide.GTP.NodeDataConnect.UpdateRowContent(Int32 index)
   at PlexityHide.GTP.NodeDataConnect.EnsureBindUpToDate()
   at PlexityHide.GTP.GridNodes.get_Count()
   at PlexityHide.GTP.GridStructure.get_FirstVisibleNode()
   at PlexityHide.GTP.Gantt.set_TurnOffAllCollisionDetect(Boolean value)
   at PlexityHide.GTP.WEB.Gantt_ASP.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.BasePartialCachingControl.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.schedule_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\13c4fe72\f906a8a8\App_Web_schedule.aspx.cdcab7d2.nhap4sin.0.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
System.Data.SqlClient.SqlException:超时已过期。操作完成前已过超时时间,或者服务器没有响应。
生成时间:2009年8月18日星期二08:05:39 GMT
System.Web.HttpUnhandledException:引发了类型为“System.Web.HttpUnhandledException”的异常。-->System.Data.SqlClient.SqlException:超时已过期。操作完成前已过超时时间,或者服务器没有响应。
位于System.Data.SqlClient.SqlConnection.OneError(SqlException异常,布尔断开连接)
位于System.Data.SqlClient.SqlInternalConnection.OneError(SqlException异常,布尔断开连接)
位于System.Data.SqlClient.TdsParser.ThroweException和Warning(TdsParserStateObject stateObj)
在System.Data.SqlClient.TdsParser.Run(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)
位于System.Data.SqlClient.SqlDataReader.ConsumerMetadata()处
在System.Data.SqlClient.SqlDataReader.get_MetaData()处
位于System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds、RunBehavior、String ResetOptions String)
位于System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、Boolean async)
位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法、DbAsyncResult)
位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法)
位于System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior,String方法)
位于System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior)
在System.Data.Common.DbCommand.ExecuteReader()中
在System.Data.Linq.SqlClient.SqlProvider.Execute(表达式查询、查询信息查询信息、IOObjectReaderFactory工厂、对象[]parentArgs、对象[]userArgs、ICompiledSubQuery[]子查询、对象lastResult)
位于System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(表达式查询、QueryInfo[]QueryInfo、IOObjectReaderFactory工厂、Object[]userArguments、ICompiledSubQuery[]subQueries)
位于System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表达式查询)
位于System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
位于System.Collections.Generic.List`1..ctor(IEnumerable`1集合)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
位于System.Data.Linq.Provider.BindingList.Create[T](DataContext上下文,IEnumerable`1序列)
在System.Data.Linq.DataQuery`1.GetNewBindingList()中
位于System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList()
位于System.Windows.Forms.CurrencyManager.SetDataSource(对象数据源)
位于System.Windows.Forms.BindingContext.EnsureListManager(对象数据源,字符串数据成员)
位于System.Windows.Forms.BindingContext.get_项(对象数据源)
在PlexityHide.GTP.TimeItemDataConnect.Wire()上
在PlexityHide.GTP.TimeItemDataConnect.UpdateDataSource(IListSource aDataSource,String aDataMember,Layer层)
在PlexityHide.GTP.TimeItemDataConnect.set_数据源(对象值)
在PlexityHide.GTP.Layer.set_数据源(对象值)
在C:\MyDev\WebSchedule\Schedule.aspx.cs中的WebSchedule._Default.Grid_oneachListItemWhenDatablue_GridNode(对象GTPComponent,每个列表项WhenDatableArgs e):第503行
在PlexityHide.GTP.Grid.NodeChangedInDS(GridNode阳极)
在PlexityHide.GTP.NodeDataConnect.UpdateRowContent(Int32索引)中
在PlexityHide.GTP.NodeDataConnect.EnsureBindUpToDate()中
在PlexityHide.GTP.GridNodes.get_Count()中
在PlexityHide.GTP.GridStructure.get_FirstVisibleNode()中
在PlexityHide.GTP.Gantt.set_TurnOffAllCollisionDetect(布尔值)
在PlexityHide.GTP.WEB.Gantt_ASP.OnPreRender(EventArgs e)上
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.BasePartialCachingControl.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Control.PreRenderCursiveInternal()中
在System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
---内部异常堆栈跟踪的结束---
位于System.Web.UI.Page.HandleError(异常e)
在System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest()中
位于System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext上下文)
在System.Web.UI.Page.ProcessRequest(HttpContext上下文)中
在c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\13c4fe72\f906a8a8\App\u Web\u schedule.aspx.cdcab7d2.nhap4sin.0.cs中的ASP.schedule\u aspx.ProcessRequest(HttpContext上下文):第0行
在System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()中
在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)
这可能是由任何时候都要连接到数据库的连接数引起的吗? 所涉及的页面调用甘特图,并根据特定的合同使用时间表中的数据填充甘特图