Name

Cancel

Synopsis


Cancel();

Halts a Command that is currently executing. If the Command isn’t executing, nothing happens. If the Command is in the middle of fetching results with a DataReader, the DataReader is closed. If the Command is in the middle of performing another time-consuming operation, an attempt is made to stop the operation. However, in this case, the Cancel( ) method must be called from another thread because the main thread will be blocked, waiting for the operation to complete.