解决ASP.NET超时时间已到问题

来源:互联网 发布:java从入门到放弃 编辑:程序博客网 时间:2024/05/10 11:54

运行.net程序出现以下错误:

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

超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。

在代码:
SqlCommand myCommand = new SqlCommand(cmdText, myConnection);
下面加以下代码:       
myCommand.CommandTimeout = 180;


在Web.Config的
<system.web>
</system.web>

中加入:
<httpRuntime maxRequestLength="102400" executionTimeout="720" />

即:

<system.web>
    <httpRuntime maxRequestLength="102400" executionTimeout="720" />
</system.web>

原创粉丝点击