-
-
I've been giving quite a few presentations lately on ADO.NET async commands and one of the most common questions I take regards the cancellation of pending commands. My answer is invariably, use the Cancel method on the SqlCommand class. One of the attentive guys I had last week pointed out that this is exactly what the MSDN documentation suggests NOT to do.
Next I got back to the excellent Pablo Castro's article where he suggests just to use Cancel.
Who's right? To me, Cancel always worked. However, the doubt that it could work by mere chance on the local host raised. Pablo was kind enough to clarify this point.
The MSDN documentation is outdated as support for cancelling asynchronous commands was added only with the last milestone before shipping .NET 2.0.
PS: This is not much technical, but ... I'll be in Orlando for DevConnections the week of April 1. Is there anybody attending the conference and willing to play some (amateur-like) tennis?