停止从.NET code SQL查询执行 [英] Stop SQL query execution from .net Code
问题描述
我是从'.NET'code执行一个存储过程。由于有大量的数据,它正在采取太多的时间来执行。有没有什么办法阻止从C#code此执行?
I'm executing one stored procedure from the '.net' code. Since there is a lot of data, it is taking too much time to execute. Is there any way to stop this execution from the c# code?
在换句话说,如果我们执行从数据库自身的查询,有一个选项,以停止执行,但在code是这可能吗?
In other words, if we execute the query from database itself, there is a option to stop its execution but in the code is it possible?
推荐答案
是sqlcommand.cancel是你的朋友<一个href=\"http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.cancel.aspx\">http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.cancel.aspx
Yes sqlcommand.cancel is your friend http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.cancel.aspx
这篇关于停止从.NET code SQL查询执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!