Tries to cancel the execution of a System.Data.SqlClient.SqlCommand.
If there is nothing to cancel, nothing occurs. However, if there is a command in process, and the attempt to cancel fails, no exception is generated.
In some, rare, cases, if you call SqlCommand.ExecuteReader then call SqlDataReader.Close (implicitily or explicitly) before calling SqlCommand.Cancel, and then call SqlCommand.Cancel, the cancel command will not be sent to SQL Server and the result set can continue to stream after you call SqlConnection.Close. To avoid this, make sure that you call SqlCommand.Cancel before closing the reader or connection.