public ConnectionHandler(enDatabaseType dbType)
 {
     DatabaseType = dbType;
     switch (dbType)
     {
         case enDatabaseType.MySql:
             mysqlConnector = new MySqlConnector(Server, Username, Password);
             break;
         case enDatabaseType.MSSql:
             mssqlConnector = new MSSqlConnector(Server, Username, Password);
             break;
         case enDatabaseType.FireBird:
             firebirdConnector = new FireBirdConnector(Server, Username, Password);
             break;
     }
 }
示例#2
0
        public ConnectionHandler(enDatabaseType dbType)
        {
            DatabaseType = dbType;
            switch (dbType)
            {
            case enDatabaseType.MySql:
                mysqlConnector = new MySqlConnector(Server, Username, Password);
                break;

            case enDatabaseType.MSSql:
                mssqlConnector = new MSSqlConnector(Server, Username, Password);
                break;

            case enDatabaseType.FireBird:
                firebirdConnector = new FireBirdConnector(Server, Username, Password);
                break;
            }
        }
示例#3
0
        public string CreateConnector(enDatabaseType enDatabaseType)
        {
            try
            {
                switch (DatabaseType)
                {
                case enDatabaseType.MySql:
                    mysqlConnector = new MySqlConnector(Server, Username, Password, Database);
                    break;

                case enDatabaseType.MSSql:
                    mssqlConnector = new MSSqlConnector(Server, Username, Password, Database);
                    break;

                case enDatabaseType.FireBird:
                    throw new NotImplementedException("Funksjon ikke tilgjengelig for FireBird-db");
                }
                return("");
            }
            catch (Exception ex)
            { return(ex.Message); }
        }
 public string CreateConnector(enDatabaseType enDatabaseType)
 {
     try
     {
         switch (DatabaseType)
         {
             case enDatabaseType.MySql:
                 mysqlConnector = new MySqlConnector(Server, Username, Password, Database);
                 break;
             case enDatabaseType.MSSql:
                 mssqlConnector = new MSSqlConnector(Server, Username, Password, Database);
                 break;
             case enDatabaseType.FireBird:
                 throw new NotImplementedException("Funksjon ikke tilgjengelig for FireBird-db");
         }
         return "";
     }
     catch (Exception ex)
     { return ex.Message; }
 }