Beispiel #1
0
        public DatabaseManager(string DbType, string connectionString)
        {
            switch (DbType.ToLower())
            {
            case "mssql":
                Type = DatabaseType.MsSql;
                Db   = new MSSql(connectionString);
                break;

            case "mysql":
                Type = DatabaseType.MySql;
                Db   = new Core.DB.MySql(connectionString);
                break;

            case "oracle":
                Type = DatabaseType.Oracle;
                Db   = new Oracle(connectionString);
                break;

            case "sqlite":
                Type = DatabaseType.SQLite;
                Db   = new SQLite(connectionString);
                break;

            default:
                throw new Exception("Database not supported");
            }
        }
Beispiel #2
0
        public DatabaseManager(DatabaseType DbType, string connectionString, bool connect = true, string debugMessage = null, bool helperQuery = false)
        {
            Type = DbType;
            switch (DbType)
            {
            case DatabaseType.MsSql:
                Db = new MSSql(connectionString);
                break;

            case DatabaseType.MySql:
                Db = new Core.DB.MySql(connectionString);
                break;

            case DatabaseType.Oracle:
                Db = new Oracle(connectionString, connect, debugMessage);
                break;

            case DatabaseType.Postgres:
                this.Db = new Postgres(connectionString, connect, debugMessage);
                break;

            case DatabaseType.SQLite:
                Db = new SQLite(connectionString);
                break;
            }

            HelperQuery = helperQuery;
        }