예제 #1
0
        public void AddInOutParameter(OracleCommand cmd, string parameterName, object value)
        {
            OracleParameter dbParameter = cmd.CreateParameter();

            dbParameter.OracleDbType  = DbTool.GetOracleDbType(value);
            dbParameter.ParameterName = parameterName;
            dbParameter.Value         = DbTool.GetParamValue(value);
            dbParameter.Direction     = ParameterDirection.InputOutput;
            cmd.Parameters.Add(dbParameter);
        }
예제 #2
0
 public void AddBatchInParameter(OracleCommand cmd, string parameterName, object[] value)
 {
     if (value.Length > 0)
     {
         // 绑定批处理的行数
         cmd.ArrayBindCount = value.Length; // 很重要
         cmd.CommandTimeout = 600;          // 10分钟
         OracleParameter dbParameter = new OracleParameter();
         dbParameter.ParameterName = parameterName;
         //dbParameter.OracleDbType = DbTool.GetOracleDbType(value);
         dbParameter.OracleDbTypeEx = DbTool.GetOracleDbType(value);
         dbParameter.Value          = DbTool.GetParamValue(value);
         dbParameter.Direction      = ParameterDirection.Input;
         cmd.Parameters.Add(dbParameter);
     }
 }