/// <summary> /// Initialize. /// </summary> /// <param name="name">Provider name.</param> /// <param name="config">Config.</param> public override void Initialize(string name, NameValueCollection config) { if (config == null) throw new ArgumentNullException("config"); base.Initialize(name, config); _connectionString = new ConnectionStringSettings() { ConnectionString = config["connectionString"], ProviderName = config["providerName"] ?? "" }; if (String.IsNullOrEmpty(_connectionString.ConnectionString)) { string connectionStringName = config["connectionStringName"]; if (connectionStringName == null || connectionStringName.Length == 0) ThrowConnectionNameNotSpecified(); _connectionString = ConfigurationManager.ConnectionStrings[connectionStringName]; if (_connectionString == null) ThrowConnectionStringNotFound(connectionStringName); } _holder = _connectionString == null || String.IsNullOrEmpty(_connectionString.ProviderName) ? OracleDbHolder.GetOracleDbHolder(OracleClientFactory.Instance, _connectionString.ConnectionString) : OracleDbHolder.GetOracleDbHolder(_connectionString.ProviderName, _connectionString.ConnectionString); _parser = new OracleAPQueryParser(); }
/// <summary> /// Initialize. /// </summary> /// <param name="name">Provider name.</param> /// <param name="config">Config.</param> public override void Initialize(string name, NameValueCollection config) { if (config == null) { throw new ArgumentNullException("config"); } base.Initialize(name, config); _connectionString = new ConnectionStringSettings() { ConnectionString = config["connectionString"], ProviderName = config["providerName"] ?? "" }; if (String.IsNullOrEmpty(_connectionString.ConnectionString)) { string connectionStringName = config["connectionStringName"]; if (connectionStringName == null || connectionStringName.Length == 0) { ThrowConnectionNameNotSpecified(); } _connectionString = ConfigurationManager.ConnectionStrings[connectionStringName]; if (_connectionString == null) { ThrowConnectionStringNotFound(connectionStringName); } } _holder = _connectionString == null || String.IsNullOrEmpty(_connectionString.ProviderName) ? OracleDbHolder.GetOracleDbHolder(OracleClientFactory.Instance, _connectionString.ConnectionString) : OracleDbHolder.GetOracleDbHolder(_connectionString.ProviderName, _connectionString.ConnectionString); _parser = new OracleAPQueryParser(); }