问题描述
近期用后台加了几篇文章后,就出现了如下错误。错误提示贴在下面了,请各位前辈帮忙看下,该如何解决啊,谢谢了。“/”应用程序中的服务器错误。超时时间已到。在操作完成之前超时时间已过或服务器未响应。说明:执行当前Web请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.Data.SqlClient.SqlException:超时时间已到。在操作完成之前超时时间已过或服务器未响应。源错误:行237:scd.Parameters.Add(sp2);行238:SqlDataAdaptersda=newSqlDataAdapter(scd);行239:sda.Fill(ds);行240:行241:outDataCount=Convert.ToInt32(sp.Value);源文件:d:wwwrootApp_CodeSiteFun.cs行:239堆栈跟踪:[SqlException(0x80131904):超时时间已到。在操作完成之前超时时间已过或服务器未响应。]System.Data.SqlClient.SqlInternalConnection.OnError(SqlExceptionexception,BooleanbreakConnection)+4846647System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjectstateObj)+194System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObjectstateObj,UInt32error)+527System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResultasyncResult,TdsParserStateObjectstateObj)+359System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()+88System.Data.SqlClient.TdsParserStateObject.ReadBuffer()+21System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[]buff,Int32offset,Int32len)+159System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32length,Encodingencoding,BooleanisPlp)+131System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffervalue,Bytetype,Int32length,Encodingencoding,BooleanisPlp,TdsParserStateObjectstateObj)+4838989System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffervalue,SqlMetaDataPrivmd,Int32length,TdsParserStateObjectstateObj)+100System.Data.SqlClient.SqlDataReader.ReadColumnData()+82System.Data.SqlClient.SqlDataReader.ReadColumn(Int32i,BooleansetTimeout)+129System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32i)+20System.Data.SqlClient.SqlDataReader.GetValues(Object[]values)+153System.Data.ProviderBase.CommonLanguageSubsetDataReader.GetValues(Object[]values)+13System.Data.ProviderBase.SchemaMapping.LoadDataRow()+44System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMappingmapping)+91System.Data.Common.DataAdapter.FillFromReader(DataSetdataset,DataTabledatatable,StringsrcTable,DataReaderContainerdataReader,Int32startRecord,Int32maxRecords,DataColumnparentChapterColumn,ObjectparentChapterValue)+164System.Data.Common.DataAdapter.Fill(DataSetdataSet,StringsrcTable,IDataReaderdataReader,Int32startRecord,Int32maxRecords)+353System.Data.Common.DbDataAdapter.FillInternal(DataSetdataset,DataTable[]datatables,Int32startRecord,Int32maxRecords,StringsrcTable,IDbCommandcommand,CommandBehaviorbehavior)+164System.Data.Common.DbDataAdapter.Fill(DataSetdataSet,Int32startRecord,Int32maxRecords,StringsrcTable,IDbCommandcommand,CommandBehaviorbehavior)+287System.Data.Common.DbDataAdapter.Fill(DataSetdataSet)+94SiteFun.pageView(StringparTableName,StringparColumn,StringparPrimaryKey,Int32parPageSize,Int32parPageIndex,StringparSqlWhere,StringparSqlOrder,Int32&outPageIndex,Int32&outPageCount,Int32&outDataCount)ind:wwwrootApp_CodeSiteFun.cs:239manage_news_list.init()ind:wwwrootmanagenews_list.aspx.cs:57manage_news_list.Page_Load(Objectsender,EventArgse)ind:wwwrootmanagenews_list.aspx.cs:24System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtrfp,Objecto,Objectt,EventArgse)+14System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Objectsender,EventArgse)+35System.Web.UI.Control.OnLoad(EventArgse)+99System.Web.UI.Control.LoadRecursive()+50System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+627版本信息:Microsoft.NETFramework版本:2.0.50727.3649;ASP.NET版本:2.0.50727.3634
解决方案
解决方案二:
其他错误信息都是浮云,可以忽略,关键看下面这句[SqlException(0x80131904):超时时间已到。在操作完成之前超时时间已过或服务器未响应。]你的sql语句是不是很复杂?执行超时了,要优化下sql语句
解决方案三:
请调试看看你执行的时候在什么地方卡住了··都超时了·