Shaun wrote on 2011-03-15 11:19:15
The "Cancel()" code is incorrect. Unless the query is being executed on another thread, the "ExecuteNonQuery" will block the current thread until the command has been fully executed. Cancel() will only be called after the command has finished, at which point, there is nothing to cancel.