public static IDbDataParameter AddParameter(IDbCommand cmd, string name, DbType dbType, object paramValue, DBKind dbKind, bool magicReplace)
        {
            IExecutionService executionService = GetExecutionForKind(dbKind);

            if (magicReplace)
            {
                paramValue = executionService.TransformRuntimeToDatabaseValue(dbType, paramValue);
            }
            return(ADOAdaptersUtils.AdapterParameter(executionService.CreateParameter(ADOAdaptersUtils.GetADOCommand(cmd), name, dbType, paramValue)));
        }
        public static IDbDataParameter AddParameterWithDirection(IDbCommand command, string name, DbType dbType, ParameterDirection direction)
        {
            try {
                Command cmd = new Command(DatabaseAccess.ForSystemDatabase.DatabaseServices.ExecutionService, ADOAdaptersUtils.GetADOCommand(command));

                return(ADOAdaptersUtils.AdapterParameter(cmd.CreateParameterWithDirection(name, dbType, direction).DriverParameter));
            } catch (ConnectionNotFoundException e) {
                throw new DBConnectionNotFoundException(e.Message);
            } catch (InvalidDatabaseAccessException e) {
                throw new InvalidDBTransactionManagerAccess(e.Message);
            } catch (InvalidTransactionReleaseException e) {
                throw new InvalidReleaseException(e.Message);
            }
        }
 public IDbDataParameter AddParameter(string connectionName, IDbCommand command, string name, DbType dbType, object paramValue)
 {
     try {
         IDbCommand        cmd = ADOAdaptersUtils.GetADOCommand(command);
         IDatabaseServices databaseServices = GetProviderFromConnectionNameOrMain(connectionName).DatabaseServices;
         Command           wrappedCommand   = new Command(databaseServices.ExecutionService, cmd);
         return(ADOAdaptersUtils.AdapterParameter(wrappedCommand.CreateParameter(name, dbType, paramValue).DriverParameter));
     } catch (ConnectionNotFoundException e) {
         throw new DBConnectionNotFoundException(e.Message);
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     } catch (InvalidTransactionReleaseException e) {
         throw new InvalidReleaseException(e.Message);
     }
 }
Exemple #4
0
        public virtual IDbDataParameter AddParameter(IDbCommand cmd, string name, DbType dbType, object paramValue)
        {
            Command command = new Command(TransactionManager.TransactionService.DatabaseServices.ExecutionService, cmd);

            return(ADOAdaptersUtils.AdapterParameter(command.CreateParameter(name, dbType, paramValue).DriverParameter));
        }
        public static IDbDataParameter AddParameter(IDbCommand cmd, string name, DbType dbType, ObjectKey key, DBKind dbKind)
        {
            Command command = new Command(GetExecutionForKind(dbKind).DatabaseServices.ExecutionService, ADOAdaptersUtils.GetADOCommand(cmd));

            return(ADOAdaptersUtils.AdapterParameter(command.CreateParameter(name, dbType, key).DriverParameter));
        }