Ejemplo n.º 1
0
      public IDbCommand CreateCommand()
      {
        IDbCommand result = _connection.CreateCommand();
#if DEBUG
        // Return a LoggingDbCommandWrapper to log all CommandText to logfile in DEBUG mode.
        result = new LoggingDbCommandWrapper(result);
#endif
        result.Transaction = _transaction;
        return result;
      }
Ejemplo n.º 2
0
        public IDbCommand CreateCommand()
        {
            IDbCommand result = _connection.CreateCommand();

            if (_settings.EnableDebugLogging)
            {
                result = new LoggingDbCommandWrapper(result);
            }
            result.Transaction    = _transaction;
            result.CommandTimeout = MSSQLDatabase.DEFAULT_QUERY_TIMEOUT;
            return(result);
        }
Ejemplo n.º 3
0
        public IDbCommand CreateCommand()
        {
            IDbCommand result = _connection.CreateCommand();

            if (_settings.EnableDebugLogging)
            {
                result = new LoggingDbCommandWrapper(result);
            }

            result.Transaction = _transaction;
            return(result);
        }
Ejemplo n.º 4
0
        public IDbCommand CreateCommand()
        {
            IDbCommand command;

            if (MockDBUtils.Connection != null)
            {
                command = MockDBUtils.Connection.CreateCommand();
                command = new LoggingDbCommandWrapper(command);
            }
            else
            {
                command = new MockCommand();
                MockDBUtils.AddCommand((MockCommand)command);
            }

            return(command);
        }
Ejemplo n.º 5
0
        private object ExecuteScalar(string command)
        {
            using (MySqlConnection connection = new MySqlConnection(_connectionString))
            {
                connection.Open();
                IDbCommand cmd = connection.CreateCommand();
#if DEBUG
                // Return a LoggingDbCommandWrapper to log all CommandText to logfile in DEBUG mode.
                cmd = new LoggingDbCommandWrapper(cmd);
#endif

                using (cmd)
                {
                    cmd.CommandText = command;
                    var result = cmd.ExecuteScalar();
                    return(result);
                }
            }
        }