Example #1
0
        protected override void ConfigureParameter(DbParameter param, string name, DbType dbType, int size, ParameterDirection direction,
                                                   bool nullable, byte precision, byte scale, string sourceColumn,
                                                   DataRowVersion sourceVersion, object value)
        {
            value        = value ?? DBNull.Value;
            param.DbType = dbType;

            ((Devart.Data.Oracle.OracleParameter)param).OracleDbType
                = (value != DBNull.Value)
                      ? OracleTool.TypeToOracleDbType(value.GetType())
                      : OracleTool.DbTypeToOracleDbType(dbType);

            param.Size         = size;
            param.Value        = value;
            param.Direction    = direction;
            param.IsNullable   = nullable;
            param.SourceColumn = sourceColumn;

            if (sourceVersion == DataRowVersion.Default)
            {
                sourceVersion = DataRowVersion.Current;
            }

            param.SourceVersion = sourceVersion;
        }
Example #2
0
        public void CreateOracleConnectionAsynchronous()
        {
            var connStr = AdoTool.DefaultConnectionStringSettings.ConnectionString;

            if (IsDebugEnabled)
            {
                log.Debug("ConnectionString=" + connStr);
            }


            bool newConnection = false;

            using (var oraConn = OracleTool.CreateOracleConnection(DefaultOracleDb, ref newConnection)) {
                using (var oraCommand = new OracleCommand(SelectDept, oraConn))
                    using (var reader = oraCommand.ExecuteReader()) {
                        Assert.IsTrue(reader.Read());
                    }
                if (newConnection)
                {
                    oraConn.Close();
                }
            }
        }