Esempio n. 1
0
        private IDBAccess NewDBConnect(DbAType dbtype, string Connecting)
        {
            IDBAccess DBA = null;

            switch (dbtype)
            {
            case DbAType.DB2:
                DBA = new DbADB2(Connecting);
                break;

            case DbAType.MsSQL:
                DBA = new DbAMsSQL(Connecting);
                break;

            case DbAType.MySql:
                DBA = new DbAMySql(Connecting);
                break;

#if NET_FW
            case DbAType.OdbcInformix:
                DBA = new DbAOdbcInformix(Connecting);
                break;

            case DbAType.OledbAccess:
                DBA = new DbAOledbAccess(Connecting);
                break;
#endif
            case DbAType.Oracle:
                DBA = new DbAOracle(Connecting);
                break;

            case DbAType.SQLite:
                DBA = new DbASQLite(Connecting);
                break;

            case DbAType.Sybase:
                DBA = new DbASybase(Connecting);
                break;
            }
            if (this.CommandTimeOut != 0)
            {
                DBA.CommandTimeOut = this.CommandTimeOut;
            }
            return(DBA);
        }
Esempio n. 2
0
        private static IDBAccess NewDBConnect(DbAType dbtype, string Connecting)
        {
            IDBAccess DBA = null;

            switch (dbtype)
            {
            case DbAType.DB2:
                DBA = new DbADB2(Connecting);
                break;

            case DbAType.MsSQL:
                DBA = new DbAMsSQL(Connecting);
                break;

            case DbAType.MySql:
                DBA = new DbAMySql(Connecting);
                break;

            case DbAType.OdbcInformix:
                DBA = new DbAOdbcInformix(Connecting);
                break;

#if FW
            case DbAType.OledbAccess:
                DBA = new DbAOledbAccess(Connecting);
                break;
#endif
            case DbAType.Oracle:
                DBA = new DbAOracle(Connecting);
                break;

            case DbAType.SQLite:
                DBA = new DbASQLite(Connecting);
                break;

#if FW
            case DbAType.Sybase:
                DBA = new DbASybase(Connecting);
                break;
#endif
            }
            return(DBA);
        }