Answer the question
In order to leave comments, you need to log in
How to cancel execution of SqlCommand?
Here is my method:
public static void Execute(SqlCommand command)
{
Thread rThread1 = new Thread(new ThreadStart(() => { command.ExecuteReader(); }));
Thread rThread2 = new Thread(new ThreadStart(() => { Thread_Cancel(command); }));
rThread1.Start();
rThread2.Start();
}
I get Exception:
Could not create constraint. See previous errors.
Operation canceled by user.
How to cancel execution of SqlCommand ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question