Exemple #1
0
        public static String GetTopRecords(String Command, String TopRecord, DBCommandFactory type)
        {
            switch (type)
            {
            case DBCommandFactory.SQLServer:
                Command = Command.Replace("select", "select Top " + TopRecord);
                return(Command);

            case DBCommandFactory.Oracle:
                if (Command.Contains("where"))
                {
                    Command += "and rownum <=" + TopRecord;
                }
                else
                {
                    Command += "rownum <=" + TopRecord;
                }
                return(Command);

            case DBCommandFactory.MySQL:
                Command += "limit " + TopRecord;
                return(Command);

            case DBCommandFactory.Access:
                Command = Command.Replace("select", "Select Top " + TopRecord);
                return(Command);

            default:
                return("");
            }
        }
Exemple #2
0
        //get nowdate function
        public static String GetSQLDate(DBCommandFactory type)
        {
            switch (type)
            {
            case DBCommandFactory.SQLServer:
                return("getdate()");

            case DBCommandFactory.Oracle:
                return("sysdate ");

            case DBCommandFactory.MySQL:
                return("curdate() ");

            case DBCommandFactory.Access:
                return("now()");

            default:
                return("");
            }
        }
 public InterceptingData(DBCommandFactory factory)
     : base(factory)
 {
     //no-op
 }
Exemple #4
0
 /// <summary>
 /// set database
 /// </summary>
 /// <param name="DataModule"></param>
 public DeleteDBCommandBuilder(DBCommandFactory DataModule)
 {
     DatabaseType = DataModule;
 }
Exemple #5
0
 /// <summary>
 /// set default database
 /// </summary>
 /// <param name="DataModule"></param>
 public DeleteDBCommandBuilder()
 {
     DatabaseType = DBCommandFactory.SQLServer;
 }
 /// <summary>
 /// set database
 /// </summary>
 /// <param name="DataModule"></param>
 public InsertDBCommandBuilder(DBCommandFactory DataModule)
 {
     DatabaseType = DataModule;
 }
 /// <summary>
 /// set default database
 /// </summary>
 /// <param name="DataModule"></param>
 public InsertDBCommandBuilder()
 {
     DatabaseType = DBCommandFactory.SQLServer;
 }
Exemple #8
0
 public TransactionFactory() {
     factory = new DBCommandFactory();
 }
Exemple #9
0
 //note use of constructor injection
 public DataImpl(DBCommandFactory factory)
 {
     CommandFactory = factory;
 }