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();
  • 相关阅读:
    routing路由模式
    MQ的订阅模式
    RabbitMq中的消息应答与持久化
    work工作消息队列Round-robin与Fair dispatch
    040 关于hive元数据的解析
    simple简单消息队列
    用户设置与virtual host配置
    Mq的介绍
    字典
    元组Tuple
  • 原文地址:https://www.cnblogs.com/senyier/p/6518614.html
Copyright © 2011-2022 走看看