Пример #1
0
        public static DbFactoryBase Instance(IDbCommand cmd)
        {
            DbFactoryBase result = Instance(DbTypeChecker.GetDatabaseType(cmd));

            result.cmd = cmd;
            return(result);
        }
Пример #2
0
        public static DbFactoryBase Instance(String connectionString)
        {
            DbFactoryBase result = Instance(DbTypeChecker.GetDatabaseType(connectionString));

            result.cn = result.GetConnection(connectionString);
            return(result);
        }
Пример #3
0
        public static DbFactoryBase Instance(IDbConnection cn)
        {
            DbFactoryBase result = Instance(DbTypeChecker.GetDatabaseType(cn));

            result.cn = cn;
            return(result);
        }
Пример #4
0
        private static DatabaseType getDbType(String dbname, String connectionString, DbConfig result)
        {
            foreach (KeyValuePair <String, String> kv in result.DbType)
            {
                if (kv.Key == dbname)
                {
                    return(DbTypeChecker.GetFromString(kv.Value));
                }
            }

            DatabaseType dbtype = DbTypeChecker.GetDatabaseType(connectionString);

            return(dbtype);
        }