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; }
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); }
public IDbCommand CreateCommand() { IDbCommand result = _connection.CreateCommand(); if (_settings.EnableDebugLogging) { result = new LoggingDbCommandWrapper(result); } result.Transaction = _transaction; return(result); }
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); }
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); } } }