public UniDbCommand() { _command = ActivatorHelper.CreateAndUnwrap <DbCommand>(ProviderSetting.ConfigurationProvider.CommandClassName); switch (ProviderSetting.CurrentDBProvider) { case DbProviderType.OracleOdpNetUnmanaged: SetBindByName(true); break; case DbProviderType.OracleOdpNetManaged: SetBindByName(true); break; } }
/// <summary> /// Конструктор параметра без /// </summary> public UniParameter() { switch (ProviderSetting.CurrentDBProvider) { case DbProviderType.OracleOdpNetUnmanaged: case DbProviderType.OracleOdpNetManaged: _parameter = ActivatorHelper.CreateAndUnwrap <DbParameter>("OracleParameter"); break; case DbProviderType.OracleMicrosoft: _parameter = ActivatorHelper.CreateAndUnwrap <DbParameter>("OracleParameter"); break; default: throw new Exception("Для провайдера не установлен конструктор параметров"); } }
/// <summary> /// Конструктор соединения с параметрами /// </summary> /// <param name="userName">имя пользователя для подключения</param> /// <param name="password">пароль для подключения</param> public UniDbConnection(string userName, string password) { _connect = ActivatorHelper.CreateAndUnwrap <DbConnection>(ProviderSetting.ConfigurationProvider.ConnectionClassName); switch (ProviderSetting.CurrentDBProvider) { case DbProviderType.OracleOdpNetManaged: _connect.ConnectionString = string.Format(ProviderSetting.ConfigurationProvider.ConnectionString, userName, "\"" + password + "\""); break; case DbProviderType.OracleOdpNetUnmanaged: _connect.ConnectionString = string.Format(ProviderSetting.ConfigurationProvider.ConnectionString, userName, "\"" + password + "\""); break; default: _connect.ConnectionString = string.Format(ProviderSetting.ConfigurationProvider.ConnectionString, userName, password); break; } }
public UniDbAdapter() { _adapter = ActivatorHelper.CreateAndUnwrap <DbDataAdapter>(ProviderSetting.ConfigurationProvider.DataAdapterClassName); }