• C#执行带参数的Oracle存储过程


     public void UpdateByRowGuid(string RowGuid)
            {
    //OracleConnection conn = new OracleConnection("data source=myoracle;User Id=feng;Password=feng");    //连接数据库
    string connectionString = System.Configuration.ConfigurationManager.AppSettings["CoonString"].ToString();
                OracleConnection con = new OracleConnection(connectionString);
    2         conn.Open();                                                  //打开数据库
    3         OracleCommand dr = new OracleCommand("ss_xs", conn);                         //连接存储过程
    4         dr.CommandType = CommandType.StoredProcedure;                           //定义连接的是存储过程
    5         OracleParameter op = dr.Parameters.Add("sdate", OracleType.VarChar, 20);         //定义参数
    6         op.Direction = ParameterDirection.Input;                                  //定义参数是输入
    7         op.Value = "20130103";                                                   //参数值
    8         dr.ExecuteNonQuery();                     //执行
    9         conn.Close();                       //关闭数据库连接
    }
    View Code
  • 相关阅读:
    邻接矩阵
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/lyhsblog/p/6265340.html
Copyright © 2020-2023  润新知