/// <summary> /// 带参数的存储过程,返回DataTable /// </summary> /// <param name="ProcName">存储过程名称</param> /// <param name="parameters">参数集合</param> /// <returns>返回datatable对象</returns> public DataTable RunProcedure2DT(string ProcName, OracleParameter[] parameters) { DataTable dt; Oracledbhelp db = new Oracledbhelp(); try { DataSet da = db.RunProcedure(ProcName, parameters, "t1"); dt = da.Tables["t1"]; } catch (Exception e) { // HGERROR.log(e + "存储过程:" + ProcName); dt = null; } finally { db.Close(); db = null; } if (dt == null) { dt = new DataTable(); } return(dt); }
/// <summary> /// 返回存储过程的输出字符串 /// </summary> /// <param name="ProcName"></param> /// <param name="parameters"></param> /// <returns></returns> public string RunProcedure2OutString(string ProcName, OracleParameter[] parameters) { string outpar = ""; Oracledbhelp db = new Oracledbhelp(); try { db.RunProcedure(ProcName, parameters); outpar = (string)parameters[parameters.Length - 1].Value.ToString(); } catch (Exception e) { } finally { db.Close(); db = null; } return(outpar); }