Exemplo n.º 1
0
        public static ISqlProvider Create(string provider)
        {
            //ISqlConverter Factory
            switch (provider)
            {
            case DbSetting.Provider_Oracle:
                if (_oracleConverter == null)
                {
                    _oracleConverter = new OracleProvider();
                }
                return(_oracleConverter);

            case DbSetting.Provider_Odbc:
                if (_odbcConverter == null)
                {
                    _odbcConverter = new ODBCProvider();
                }
                return(_odbcConverter);

            case DbSetting.Provider_SqlClient:
            case DbSetting.Provider_SqlCe:
            default:
                if (_sqlConverter == null)
                {
                    _sqlConverter = new SqlServerProvider();
                }
                return(_sqlConverter);
                //throw new NotSupportedException("This type of database is not supportted now:" + provider);
            }
        }
Exemplo n.º 2
0
        public static ISqlProvider Create(string provider)
        {
            //ISqlConverter Factory
            switch (provider)
            {
                case DbSetting.Provider_Oracle:
                    if (_oracleConverter == null) _oracleConverter = new OracleProvider();
                    return _oracleConverter;

                case DbSetting.Provider_Odbc:
                    if (_odbcConverter == null) _odbcConverter = new ODBCProvider();
                    return _odbcConverter;

                case DbSetting.Provider_SqlClient:
                case DbSetting.Provider_SqlCe:
                default:
                    if (_sqlConverter == null) _sqlConverter = new SqlServerProvider();
                    return _sqlConverter;
                //throw new NotSupportedException("This type of database is not supportted now:" + provider);
            }
        }