国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

時(shí)間已到在操作完成之前超時(shí)時(shí)間已過或服務(wù)器

2024-04-25 20:44:15
字體:
供稿:網(wǎng)友
Timeout 時(shí)間已到。在操作完成之前超時(shí)時(shí)間已過或服務(wù)器未響應(yīng)。 說明: 執(zhí)行當(dāng)前 Web 請求期間,出現(xiàn)未經(jīng)處理的異常。請檢查堆棧跟蹤信息,以了解有關(guān)該錯(cuò)誤以及代碼中導(dǎo)致錯(cuò)誤的出處的詳細(xì)信息。 
異常詳細(xì)信息: System.Data.SqlClient.SqlException: Timeout 時(shí)間已到。在操作完成之前超時(shí)時(shí)間已過或服務(wù)器未響應(yīng)。
源錯(cuò)誤: 
執(zhí)行當(dāng)前 Web 請求期間生成了未經(jīng)處理的異常。可以使用下面的異常堆棧跟蹤信息確定有關(guān)異常原因和發(fā)生位置的信息。 
堆棧跟蹤: 
[SqlException (0x80131904): Timeout 時(shí)間已到。在操作完成之前超時(shí)時(shí)間已過或服務(wù)器未響應(yīng)。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlDataReader.SetMetaData(_SqlMetaDataSet metaData, Boolean moreInfo) +128
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1810
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +86
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +311
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +10
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +144
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +166
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
DAL.DataAccess.Query(String sql) in E:/V2WAP/NesSales/NesSales/SourceCode/Wap/DAL/Class1.cs:38
BUL.Bussiness.SeachProductListByDate(DateTime date, String userid, String selectid) in E:/V2WAP/NesSales/NesSales/SourceCode/Wap/BUL/Class1.cs:280
Login1.Form1_Activate(Object sender, EventArgs e) +281
System.Web.UI.MobileControls.Form.OnActivate(EventArgs e) +118
System.Web.UI.MobileControls.MobilePage.set_ActiveForm(Form value) +128
Login1.List2_ItemCommand(Object sender, ListCommandEventArgs e) +77
System.Web.UI.MobileControls.List.OnItemCommand(ListCommandEventArgs e) +115
System.Web.UI.MobileControls.List.RaisePostBackEvent(String eventArgument) +186
System.Web.UI.MobileControls.List.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +4
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.MobileControls.MobilePage.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +79
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

解決方案:

方法有以下三種:

1.原因應(yīng)該在數(shù)據(jù)訪問有問題,可以把連接時(shí)間設(shè)置長些,在數(shù)據(jù)庫連接字符串,加上Connect Timeout=18000,單位毫秒

 

2,在web.config中加上以下語句:

<system.web>  

<httpRuntime maxRequestLength="102400" executionTimeout="720" />

</system.web>   

來自MSDN解釋:
     httpRuntime是配置asp.net http運(yùn)行時(shí)設(shè)置,以確定如何處理對asp.net應(yīng)用程序的請求。
     executionTimeout:表示允許執(zhí)行請求的最大時(shí)間限制,單位為秒
     maxRequestLength:指示 ASP.NET 支持的最大文件上載大小。該限制可用于防止因用戶將大量文件傳遞到該服務(wù)器而導(dǎo)致的拒絕服務(wù)攻擊。指定的大小以 KB 為單位。默認(rèn)值為 4096 KB (4 MB)。
     useFullyQualifiedRedirectUrl:表示指示客戶端重定向是否是完全限定的(采用 "http://server/path" 格式,這是某些移動(dòng)控件所必需的),或者指示是否代之以將相對重定向發(fā)送到客戶端。如果為 True,則所有不是完全限定的重定向都將自動(dòng)轉(zhuǎn)換為完全限定的格式。false 是默認(rèn)選項(xiàng)。
     minFreeThreads:表示指定允許執(zhí)行新請求的自由線程的最小數(shù)目。ASP.NET 為要求附加線程來完成其處理的請求而使指定數(shù)目的線程保持自由狀態(tài)。默認(rèn)值為 8。
    minLocalRequestFreeThreads:表示ASP.NET 保持的允許執(zhí)行新本地請求的自由線程的最小數(shù)目。該線程數(shù)目是為從本地主機(jī)傳入的請求而保留的,以防某些請求在其處理期間發(fā)出對本地主機(jī)的子請求。這避免了可能的因遞歸重新進(jìn)入 Web 服務(wù)器而導(dǎo)致的死鎖。
    appRequestQueueLimit:表示ASP.NET 將為應(yīng)用程序排隊(duì)的請求的最大數(shù)目。當(dāng)沒有足夠的自由線程來處理請求時(shí),將對請求進(jìn)行排隊(duì)。當(dāng)隊(duì)列超出了該設(shè)置中指定的限制時(shí),將通過“503 - 服務(wù)器太忙”錯(cuò)誤信息拒絕傳入的請求。
    enableVersionHeader:表示指定 ASP.NET 是否應(yīng)輸出版本標(biāo)頭。Microsoft Visual Studio 2005 使用該屬性來確定當(dāng)前使用的 ASP.NET 版本。對于生產(chǎn)環(huán)境,該屬性不是必需的,可以禁用。

3,解決方法很簡單,在代碼中找到命令對象比如SqlCommand對象,給CommandTimeOut屬性賦一個(gè)比較大的值。比如60 秒,SqlCommand缺省超時(shí)設(shè)定是30秒。也可以將sqlcommand的timeout屬性設(shè)為0.

備注:

值 0 指示無限制,在 CommandTimeout 中應(yīng)避免值 0,否則會(huì)無限期地等待執(zhí)行命令。

[C#] 
public void CreateMySqlCommand() 
{
   SqlCommand myCommand = new SqlCommand();
   myCommand.CommandTimeout = 15;
   myCommand.CommandType = CommandType.Text;
}

see frame=true
    
SqlDataAdapter   da=   new   SqlDataAdapter();   
da.SelectCommand.CommandTimeout   = 60;

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 淳化县| 右玉县| 洛隆县| 无棣县| 白玉县| 邮箱| 黑水县| 茶陵县| 姜堰市| 滨州市| 靖安县| 江油市| 灵台县| 桦南县| 宿松县| 吉林省| 白山市| 肇东市| 化德县| 长子县| 寿阳县| 和顺县| 谷城县| 兴宁市| 建昌县| 白玉县| 牟定县| 通化市| 浙江省| 肥东县| 钟祥市| 玉溪市| 石林| 双鸭山市| 乌海市| 平安县| 嘉黎县| 玉门市| 通道| 通道| 榆林市|