asp.net中如何调取数据库中存储过程输出的两个变量
public DataTable GetList_GenqtyNumPrice(int _peoid, int _genstorageid,int _goodsid) { DataSet ds = new DataSet(); OracleParameter[] parameters ={ new OracleParameter("peoid_in",OracleType.Int32,22), new OracleParameter("genstorageid_in",OracleType.Int32,22), new OracleParameter("Goods_id_in",OracleType.Int32,22), new OracleParameter("GENQTY_out",OracleType.Number), new OracleParameter("avgprice_out",OracleType.Number) }; parameters[0].Value = _peoid; parameters[1].Value = _genstorageid; parameters[2].Value = _goodsid; parameters[3].Direction = ParameterDirection.Output; parameters[4].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[3].Value.ToString(); row["avgprice_out"] = parameters[4].Value.ToString(); //把有值的列添加到表 dt.Rows.Add(row); return dt; }
我还是会相信,星星会说话,石头会开花,穿过夏天的栅栏和冬天的风雪过后,你终会抵达。