繁体   English   中英

Asp.net Web表单“等待操作超时”

[英]Asp.net web form “The wait operation timed out”

我有一个构建为从报表服务器检索数据的Web表单。 我没有权限在要在该服务器上查询的表上创建索引,并且查询在文本查找上非常非常慢。 我已经尝试优化查询中的功能,但这只会很慢。 因此,我需要找到一种避免网页本身超时的方法。 我复习了几个类似的问题,设置了疯狂的高连接超时,但是单击按钮后仍然出现等待操作超时。 即使我设置了很高的连接超时,超时也会在30秒后发生。 我不知道这是否是Web配置,但是我没有使用在我的Webconfig中定义的连接字符串,仅在后面的代码中使用了此字符串。 仅当从Web表单访问数据时,查询才会在SSMS中超时(从技术上讲,这是在连接字符串中使用我的登录凭据,因此不存在任何权限问题,其他部分可以正常运行)。 我还需要增加页面超时时间吗?

连接字符串(出于私密性考虑,不输入x或输入x):

server=lxxxxxx.resources.xxx; Initial Catalog=pxxxxxxxx;User ID=mfeXXXXX;Password=XXXXXX;Trusted_Connection=False; Connection Timeout=10000"

查询超时,如果有帮助:

 protected void btnSearchFeedback_Click(object sender, EventArgs e)
    {
        con.Open();
        SqlDataAdapter sdaFeedBack = new SqlDataAdapter("SELECT CTIR.portion_ID, IB.Item_ID as [Item ID], CTIR.Item_DBkey as [Item DB Key], CTIR.Feedback as [Feedback], CTA.date as [Date],CTA.Candidate_ID as [Candidate ID] FROM Canxxxxxxx CTIR WITH (NOLOCK) left join Ixxxxx IB WITH (NOLOCK) ON CTIR.xxxxx = IB.xxxxx left join Cxxxxxx CTA WITH (NOLOCK) ON CTxxxxxx = CTxxxxxxx where (ctir.portion_id in (" + portionIDTextBox.Text + ") ) AND (len(CTIR.Feedback) > 0) and CTA.Date  > '2015-02-01 00:00:00.000' order by [Date]", con);
        DataSet dtFeedBack = new DataSet();
        sdaFeedBack.Fill(dtFeedBack);
        ViewState["dtFeedback"] = dtFeedBack;
        rptFeedBack.DataSource = dtFeedBack;
        rptFeedBack.DataBind();
        con.Close();
    }

再次,为了安全起见,将表名删除。 因此,我试图查看是否还有其他位置需要将连接超时设置为更高的数字,以避免“ /应用程序中的服务器错误。等待操作超时”,或者这是需要处理的问题在服务器端?

这是确切的错误:

“ /”应用程序中的服务器错误。

等待操作超时说明:执行当前Web请求期间发生未处理的异常。 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

异常详细信息:System.ComponentModel.Win32Exception:等待操作超时

堆栈跟踪:[Win32Exception(0x80004005):等待操作超时]

[SqlException(0x80131904):超时已过期。 操作完成之前超时的时间,或者服务器没有响应。] System.Data.SqlClient.SqlConnection.OnError(SqlException异常,布尔型breakConnection,操作1 wrapCloseInAction) +2434922 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction)+5736592 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,布尔调用程序HasConnectionLock,布尔asyncClose)+285 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavier,Sql dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj,布尔值和dataReady)+3731 System.Data.SqlClient.SqlDataReader.TrySetMetaData(_SqlMetaDataSet metaData,布尔moreInfo)+198 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavier,Sql Sql BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject st ateObj,布尔值和dataReady)+2852 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()+58 System.Data.SqlClient.SqlDataReader.get_MetaData()+89 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,字符串resetOptionsString)+379 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,布尔异步,Int32超时,任务和任务,布尔asyncWrite,SqlDataReader ds,布尔describeParameterEncryptionRequest)+2026系统数据。 .RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,String方法,TaskCompletionSource`1完成,Int32超时,任务和任务,布尔asyncWrite)+375 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior,RunBehavior runB字符串方法)+53 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为,字符串方法)+2 40 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior行为)+41 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior行为)+12 System.Data.Common.DbDataAdapter.FillInternal(DataSet数据集, DataTable []数据表,Int32 startRecord,Int32 maxRecords,String srcTable,IDbCommand命令,CommandBehavior行为)+139 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,Int32 startRecord,Int32 maxRecords,字符串srcTable,IDbCommand命令,CommandBehavior行为) +136 System.Data.Common.DbDataAdapter.Fill(数据集数据集)+88 FeedBackForm.btnSearchFeedback_Click(对象发送者,EventArgs e)在C:\\ Users \\ mfelchlin \\ Documents \\ Visual Studio 2015 \\ WebSites \\ devFormsSite \\ FeedBackForm.aspx.cs :27 System.Web.UI.WebControls.Button.OnClick(EventArgs e)+9696694 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)+204 System.Web.UI.WebControls.Button.System.Web。 UI.IPostBackEventHandler.RaisePostBackEvent(String eventArg ument)+12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,String eventArgument)+15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)+35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,布尔值includeStagesAfterAsyncPoint +1639

sdaFeedBack.SelectCommand.CommandTimeout=120; //or some other number of seconds.

在连接上设置超时将确定等待连接打开的时间,而不是命令执行的时间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM