本文介绍了如何解决时间过期异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨亲爱的所有 可以告诉我如何解决我的asp .net网站应用程序中的时间过期错误。 我使用了存储过程,执行大约需要2分钟。这个SP用于某种验证目的,使用3个表。这3个表包含数百万个数据。但是执行时间仅为2分钟左右。当我运行aspx页面时,我得到以下给出的错误: -------------- System.Data.SqlClient.SqlException(0x80131904):超时已过期。操作完成之前经过的超时时间或服务器没有响应。在System.Data.SqlClient.SqlConnection.OnError(SqlException异常,布尔breakConnection)处于System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,布尔breakConnection)的System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()处于System.Data System.Data.SqlClient.SqlCommand的System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,String resetOptionsString)中的.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj) System.Data.SqlClient.SqlCommand的System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String方法,DbAsyncResult结果)中的.RunExecuteReaderTds(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,Boolean async)。 InternalExecuteNonQuery(DbAsyncResult结果,String methodName,Boolean sendT oPipe)位于e:\\\\\\\\\\ br /> --------------------- 我把500s超时web配置文件,也试过cmd.CommandTimeout = 500;在代码后面。我得到同样的错误..如果有人对此有任何想法,请帮助我。 谢谢... 解决方案 如果你已经尝试了从后端500分钟,并且它没有工作,你有数百万的记录。 我测试了我的数据库是t对于11,000条记录,大约需要2到3分钟。 因此,可能需要花费大量时间进行数百万次重新编码。 你可以用更少的数据来选择而不是整个记录。你可以在命令时间长度再试一次增加 cmd.CommandTimeout = 1800; // 30分钟 Hi Dear Allcould any one please tell me how to fix the time expired error in my asp .net web site application.I have used a stored procedure and it will take around 2 minutes for execution. this SP is used for some kind of validation purpose using 3 tables.These 3 tables contains millions of data.But the excecution time is only arround 2 minutes.When ever I run the aspx page I got the below given error:--------------System.Data.SqlClient.SqlException (0x80131904): 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() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ASP.claimvalidation_aspx.btn_Click(Object sender, EventArgs e) in e:\ICE\claimvalidation.aspx:line 1362---------------------I have put 500s timeout in web config file and also tried cmd.CommandTimeout=500; at code behind.Still I am getting the same error.. Kindly help me if anyone has any idea about this.Thank You ... 解决方案 这篇关于如何解决时间过期异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-15 23:54