Exemple #1
0
 public ODAContext(DbAType DbType, string ConectionString)
 {
     if (string.IsNullOrWhiteSpace(ConectionString))
     {
         throw new ODAException(30002, "DataBase Conection String should be setted.");
     }
     _Conn = new ODAConnect()
     {
         DBtype           = DbType,
         ConnectionString = ConectionString
     };
     _IsConfig = false;
 }
Exemple #2
0
 public static void SetODAConfig(DbAType DbType, string ConectionString)
 {
     if (string.IsNullOrWhiteSpace(ConectionString))
     {
         throw new ODAException(30010, "DataBase Conection String should be setted.");
     }
     ODAConfig = new ODAConfiguration()
     {
         Pattern     = ODAPattern.Single,
         ODADataBase = new ODAConnect()
         {
             DBtype           = DbType,
             ConnectionString = ConectionString
         }
     };
 }
Exemple #3
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);
        }
Exemple #4
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);
        }