停止从.NET code SQL查询执行 [英] Stop SQL query execution from .net Code

查看:171
本文介绍了停止从.NET code SQL查询执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从'.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屋!

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