public DbConnectionHelper(string providerName, string connectionString) { this._dbProvFactory = DbProviderFactories.GetFactory(providerName); this._connection = this._dbProvFactory.CreateConnection(); this._hasConnection = (this._connection != null); if (this._hasConnection) { this._connection.ConnectionString = connectionString; this._connection.Open(); } }