예제 #1
0
        public UniDbCommand()
        {
            _command = ActivatorHelper.CreateAndUnwrap <DbCommand>(ProviderSetting.ConfigurationProvider.CommandClassName);
            switch (ProviderSetting.CurrentDBProvider)
            {
            case DbProviderType.OracleOdpNetUnmanaged: SetBindByName(true); break;

            case DbProviderType.OracleOdpNetManaged: SetBindByName(true); break;
            }
        }
예제 #2
0
        /// <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("Для провайдера не установлен конструктор параметров");
            }
        }
예제 #3
0
        /// <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;
            }
        }
예제 #4
0
 public UniDbAdapter()
 {
     _adapter = ActivatorHelper.CreateAndUnwrap <DbDataAdapter>(ProviderSetting.ConfigurationProvider.DataAdapterClassName);
 }