You can't do this in a single threaded application, because control won't return until a) the query has completed execution or b) an exception forces control to return.
Instead, you can start and execute all transactions in a worker thread and close the connection from the original thread if needed. Calling MySqlConnection.Close()
will rollback any pending transactions.