MySql.Data.MySqlClient.MySqlCommand.Cancel C# (CSharp) Method

Cancel() public method

Attempts to cancel the execution of a currently active command
Cancelling a currently active query only works with MySQL versions 5.0.0 and higher.
public Cancel ( ) : void
return void
        public override void Cancel()
        {
            connection.CancelQuery(connection.ConnectionTimeout);
        }

Usage Example

コード例 #1
0
ファイル: command.cs プロジェクト: aaasoft/Quick.MySQL.Data
        private void TimeoutExpired(object commandObject)
        {
            MySqlCommand cmd = (commandObject as MySqlCommand);

            if (cmd == null)
            {
                Logger.LogWarning(Resources.TimeoutExpiredNullObject);
                return;
            }

            cmd.timedOut = true;
            try
            {
                cmd.Cancel();
            }
            catch (Exception ex)
            {
                // if something goes wrong, we log it and eat it.  There's really nothing
                // else we can do.
                if (connection.Settings.Logging)
                {
                    Logger.LogException(ex);
                }
            }
        }
All Usage Examples Of MySql.Data.MySqlClient.MySqlCommand::Cancel