在ado.net中实现oracle存储过程调用两种方式
时间:2021-07-01 10:21:17
帮助过:21人阅读
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();
在ado.net中实现oracle存储过程调用两种方式
标签:arch ati input rac ext log parameter his open