如何在asp.net C#中更改Sql Helper默认时间。 [英] How to change Sql Helper Default time in asp.net C#.

查看:88
本文介绍了如何在asp.net C#中更改Sql Helper默认时间。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net C#中更改Sql Helper默认时间。





在asp.net中显示超时错误但是程序运行正确地在Sql Server

How to change Sql Helper Default time in asp.net C#.


Showing Timeout Error in asp.net but Procedure run properly in Sql Server

推荐答案

可能你不能 - 或者至少不是真正有用的方式。

你可能能够通过更改SqlComamnd的CommandTimeout属性来更改它: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout%28v=vs.110%29.aspx?f = 255& MSPPError = -2147217396 [ ^ ]



但......如果你的命令超时,那么你可能需要查看你的查询并努力改进那个ra而不是给它更多的时间。延长超时可能允许它完成(如果您的托管服务没有它自己的覆盖限制,有些会这样做)但如果您的页面长时间没有响应等待SQL完成处理,则用户可能会假设你死了,去其他地方......
Probably, you can't - or at least not in a really useful way.
You may be able to change it by altering the CommandTimeout property of the SqlComamnd: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396[^]

But...if your command is timing out, then you probably need to look at your query and work on improving that rather than giving it more time. Extending the timeout may allow it to finish (if your hosting service doesn't have it's own overriding limits, and some do) but if your page is unresponsive for a long time waiting for your SQL to finish processing, the user is likely to assume you are dead and go elsewhere...


这篇关于如何在asp.net C#中更改Sql Helper默认时间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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