protected virtual void CreateConnection(string providerName)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "System.Data.SqlClient";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, null, null);

            _connection = fac.CreateConnection(); //  new SqlConnection();
            _connection.ConnectionString = _connectionString;
            _connection.Open();

            string collationString = null;
            var    collation       = this.ExecuteScalar("SELECT DATABASEPROPERTYEX('" + _connection.Database + "', 'Collation')");

            if (collation != null)
            {
                collationString = collation.ToString();
            }
            if (string.IsNullOrWhiteSpace(collationString))
            {
                collationString = "Latin1_General_CI_AS";
            }
            this.Dialect.RegisterProperty(ColumnProperty.CaseSensitive, "COLLATE " + collationString.Replace("_CI_", "_CS_"));
        }
 public IngresTransformationProvider(Dialect dialect, string connectionString, string scope, string providerName)
     : base(dialect, connectionString, null, scope)
 {
     if (string.IsNullOrEmpty(providerName)) providerName = "Ingres.Client";
     var fac = DbProviderFactoriesHelper.GetFactory(providerName, null, null);
     _connection = fac.CreateConnection();
     _connection.ConnectionString = _connectionString;
     this._connection.Open();
 }
Пример #3
0
        protected virtual void CreateConnection(string providerName)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "System.Data.SQLite";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, "System.Data.SQLite", "System.Data.SQLite.SQLiteFactory");

            _connection = fac.CreateConnection(); // new SQLiteConnection(_connectionString);
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }
        protected override void CreateConnection(string providerName)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "System.Data.OracleClient";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, null, null);

            _connection = fac.CreateConnection(); // new OracleConnection();
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }
        protected virtual void CreateConnection(string providerName)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "Oracle.DataAccess.Client";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, null, null);

            _connection = fac.CreateConnection(); // new OracleConnection();
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }
Пример #6
0
        public FirebirdTransformationProvider(Dialect dialect, string connectionString, string scope, string providerName)
            : base(dialect, connectionString, null, scope)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "FirebirdSql.Data.FirebirdClient";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, "FirebirdSql.Data.FirebirdClient", "FirebirdSql.Data.FirebirdClient.FirebirdClientFactory");

            _connection = fac.CreateConnection();
            _connection.ConnectionString = _connectionString;
            this._connection.Open();
        }
        public PostgreSQLTransformationProvider(Dialect dialect, string connectionString, string defaultSchema, string scope, string providerName)
            : base(dialect, connectionString, defaultSchema, scope)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "Npgsql";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, "Npgsql", "Npgsql.NpgsqlFactory");

            _connection = fac.CreateConnection(); //new NpgsqlConnection();
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }
Пример #8
0
        public MySqlTransformationProvider(Dialect dialect, string connectionString, string scope, string providerName)
            : base(dialect, connectionString, null, scope)             // we ignore schemas for MySql (schema == database for MySql)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "MySql.Data.MySqlClient";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, "MySql.Data", "MySql.Data.MySqlClient.MySqlClientFactory");

            _connection = fac.CreateConnection();             //new MySqlConnection(_connectionString) {ConnectionString = _connectionString};
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }
        public MariaDBTransformationProvider(Dialect dialect, string connectionString, string scope, string providerName)
            : base(dialect, connectionString, scope, providerName)
        {
            if (string.IsNullOrEmpty(providerName))
            {
                providerName = "MySql.Data.MySqlClient";
            }
            var fac = DbProviderFactoriesHelper.GetFactory(providerName, "MySql.Data", "MySql.Data.MySqlClient.MySqlClientFactory");

            _connection = fac.CreateConnection();
            _connection.ConnectionString = _connectionString;
            _connection.Open();
        }