public void Dispose()
 {
     if (_connection != null)
     {
         _connection.Dispose();
     }
     _connection = null;
     _database = null;
     _command = null;
 }
        /// <summary>
        /// Metodo que termina transaccion exitosa
        /// </summary>
        public void CommitTransaction()
        {
            try
            {
                _dbTransaction.Commit();
                _dbTransaction.Dispose();
                _dbconnection.Close();
                _dbconnection = null;

                _mlconnection.Dispose();
                _mlconnection = null;
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void Dispose()
        {
            if (_dbTransaction != null)
            {
                _dbTransaction.Dispose();
            }
            _dbTransaction = null;

            if (_mlconnection != null)
            {
                _mlconnection.Dispose();
            }
            _mlconnection = null;

            if (_dbconnection != null)
            {
                _dbconnection.Dispose();
            }
            _dbconnection = null;
        }
        private ConnectionML _mlconnection; //Objeto de tipo MLConnection para obtener cadena de conexion a la base de datos

        #endregion Fields

        #region Constructors

        public TransactionML()
        {
            _mlconnection = new ConnectionML();
        }
        /// <summary>
        /// Metodo que termina transaccion fallida
        /// </summary>
        public void RollbackTransaction()
        {
            try
            {
                _dbTransaction.Rollback();
                _dbTransaction.Dispose();
                _dbconnection.Close();
                _dbconnection = null;

                _mlconnection.Dispose();
                _mlconnection = null;
            }
            catch (Exception ex)
            {

                throw;
            }
        }
 public BaseML()
 {
     _connection = new ConnectionML();
     _database = _connection.getDatabase();
 }