如何取消执行sqlcommand?

时间:2014-07-01 12:40:00

标签: c# .net multithreading task sqlcommand

我有以下方法:

public void Test(SqlCommand command)
{
   command.ExecuteReader();
   Thread rThread2 = new Thread(new ThreadStart(() => { command.Cancel(); }));
   rThread2.Start();
}

但是我无法在执行时取消sqlcommand。

我需要如何更改代码? 如果可能的话,提供一个包含任务的解决方案。

0 个答案:

没有答案
相关问题