1、常规的存储过程调用

String or=ConfigurationManager.ConnectionStrings["conn"].ToString();

OracleConnection oc = new OracleConnection(or);

oc.Open();

OracleCommand om = oc.CreateCommand();

om.CommandType = CommandType.StoredProcedure;

om.CommandText = "proc2";

om.Parameters.Add("v_id", OracleType.Number).Direction = ParameterDirection.Input;

om.Parameters["v_id"].Value = this.TextBox2.Text.Trim();

om.Parameters.Add("v_name", OracleType.NVarChar).Direction = ParameterDirection.Input;

om.Parameters["v_name"].Value = this.TextBox3.Text.Trim(); om.ExecuteNonQuery();

oc.Close();

 

2、调用无返回值存储过程

String or=ConfigurationManager.ConnectionStrings["conn"].ToString();

OracleConnection oc = new OracleConnection(or);

oc.Open();

OracleCommand om = oc.CreateCommand();

om.CommandType = CommandType.Text;

om.CommandText = "call PRO_USER_BOSS(a,b,c)";//a,b,c为传入的存储过程参数及值
om.ExecuteNonQuery(); oc.Close();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2021-12-07
  • 2021-11-12
  • 2021-06-06
  • 2021-09-07
  • 2022-01-16
相关资源
相似解决方案