C#调用存储过程反回值的问题,请各位帮帮忙!
调用函数:
public string mp_node(string in_busi_id, string in_bureau_id, string in_worker_no, string in_notes)
{
OracleParameter p1 = new OracleParameter( "in_busi_id ", OracleType.VarChar, 3);
p1.Value = in_busi_id;
p1.Direction = ParameterDirection.Input;
OracleParameter p2 = new OracleParameter( "in_bureau_id ", OracleType.VarChar, 6);
p2.Value = in_bureau_id;
p2.Direction = ParameterDirection.Input;
OracleParameter p3 = new OracleParameter( "in_worker_no ", OracleType.VarChar, 6);
p3.Value = in_worker_no;
p3.Direction = ParameterDirection.Input;
OracleParameter p4 = new OracleParameter( "in_notes ", OracleType.VarChar, 50);
p4.Value = in_notes;
p4.Direction = ParameterDirection.Input;
OracleParameter p5 = new OracleParameter( "out_flag ", OracleType.VarChar, 4);
p5.Direction = ParameterDirection.Output;
OracleParameter p6 = new OracleParameter( "out_mess ", OracleType.VarChar, 200);
p6.Direction = ParameterDirection.Output;
OracleConnection conn = DB.CreateHnmater();
conn.Open();
OracleCommand cmd = new OracleCommand( "mp_node_create ",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(p1);
cmd.Parameters.Add(p2);
cmd.Parameters.Add(p3);
cmd.Parameters.Add(p4);
cmd.ExecuteNonQuery();
return p6.Value.ToString();
}
调用:
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = mp_node( "PA ", "hys ", "001 ", "text ");