出现Sql异常的问题 - ASP.NET中的超时过期错误 [英] Problem occurring of Sql Exception - Timeout Expired Error in ASP.NET

查看:93
本文介绍了出现Sql异常的问题 - ASP.NET中的超时过期错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从sql server执行存储过程时,执行时间不到3秒。但是当我从asp.net代码中区分它然后它给出超时过期错误 - Sql例外..







请给我任何解决方案....



i搜索了很多,但没有找到任何最佳解决方案。我找到了某个地方来增加sql命令的超时时间..我做了但是它减慢了从asp.net代码存储过程的优势....但我的查询甚至在sql server端快。

While executing stored procedure from sql server then it takes less than 3 sec to execute. but when i exceute it from asp.net code then it gives Time out expired error - Sql Exception..



Please provide me any solution....

i have searched a lot but didn't find any best solution. i found somewhere to increase timeout period of sql command..i did it but it slows down the exceution of stored procedure from asp.net code.... but my query is even fast at sql server end.

推荐答案

尝试在asp.net查询中使用CommandTimeout = 0,如果您使用的是SqlHelper,则需要将其替换为ADO.Net对象。
Try to use the CommandTimeout = 0 in your asp.net query, if you are using SqlHelper then you need to replace that with the ADO.Net objects.


这篇关于出现Sql异常的问题 - ASP.NET中的超时过期错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆