asp.net中如何调取数据库中存储过程输出的两个变量

 public DataTable GetList_GenqtyNumPrice(int _peoid, int _genstorageid,int _goodsid)
{
DataSet ds = new DataSet();
OracleParameter[] parameters ={
new OracleParameter("peoid_in",OracleType.Int32,),
new OracleParameter("genstorageid_in",OracleType.Int32,),
new OracleParameter("Goods_id_in",OracleType.Int32,),
new OracleParameter("GENQTY_out",OracleType.Number),
new OracleParameter("avgprice_out",OracleType.Number)
};
parameters[].Value = _peoid;
parameters[].Value = _genstorageid;
parameters[].Value = _goodsid;
parameters[].Direction = ParameterDirection.Output;
parameters[].Direction = ParameterDirection.Output; DbHelperOra.RunProcedure("PACK_COMM.P_GetGenqtyNumPrice", parameters, "dt"); DataTable dt = new DataTable();
//创建表中的列
dt.Columns.Add("GENQTY_out");
dt.Columns.Add("avgprice_out");
DataRow row = dt.NewRow();
//给列赋值
row["GENQTY_out"] = parameters[].Value.ToString();
row["avgprice_out"] = parameters[].Value.ToString();
//把有值的列添加到表
dt.Rows.Add(row);
return dt;
}
上一篇:使用Spring Boot开发 “Hello World” Web应用


下一篇:预编译 .pch文件