zoukankan      html  css  js  c++  java
  • 在ado.net中实现oracle存储过程调用两种方式

     

    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();
  • 相关阅读:
    python 多个变量赋值
    python标准数据类型
    Python 变量类型
    H3C 扩展ACL与基于时间的ACL
    H3C BGP-filter-policy
    H3C 标准ACL
    H3C BGP实验集合
    H3C IS-IS实验大集合(ipv6)
    H3C ISIS实验大集合(IPv4)
    JS 封装一个显示时间的函数
  • 原文地址:https://www.cnblogs.com/senyier/p/6518614.html
Copyright © 2011-2022 走看看