Stop SQL query execution from .net Code

萝らか妹 提交于 2019-11-26 21:05:41

Yes, you can cancel the query by using SqlCommand.Cancel. However, the command must be running in another thread (otherwise Cancel will be called only after the command is finished).

Also you can specify a CommandTimeout if you want to cancel this query when it runs over a specified time limit.

You can do myCommand.Cancel(), and this will work best as even i have face similar issue in past, and using myCommand.Cancel() i have solved my issue. :) :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!