The most accurate way to make sure DbCommand.Cancel() method is working well?

200 views Asked by At

As we know, there's no exception occur on this method. So I have a solution to make sure that it's working.

My solution is using SQL Server Profiler tool to catch SP with Events: RPC:Starting, RPC:Completed. When I call Cancel() method and verify on Profiler, this actually completed with shorter duration than usual.

Did I kill this process completely (100% for sure)?

If I'm wrong, please show me the way to prove.

Thanks in advance !!!

1

There are 1 answers

1
simon at rcl On

Create a query which changes data; run it asynchrously (ExecuteNonQueryAsync) and immediately cancel it. Did the data change or not?

Although why you're testing the Framework is beyond me...

Cheers -