zoukankan      html  css  js  c++  java
  • .NET调用带参数存储过程

           
            string str = "Data Source=.;Initial Catalog=SCR_2p0_Staging;Integrated Security=True";
            SqlConnection conn = new SqlConnection(str);
            conn.Open();
            string text = "dt_AdminTool_ServiceObjectChildList";
            SqlCommand command = new SqlCommand(text, conn);
           
    command.CommandType = CommandType.StoredProcedure;
           
    command.Parameters.Add("parentid", SqlDbType.Int).Value = id;//parentid 输入的参数
            SqlDataReader reader = command.ExecuteReader();
            reader["child_id"].tostring();
            reader["child_name"].tostring();//child_id和child_name都是数据库里的字段名

  • 相关阅读:
    长宽广州地区DNS
    修改PHP的memory_limit限制
    适用于Magento的最合适的.htaccess写法
    在magento中如何回复客户的评论
    冲刺!
    冲刺!
    冲刺!
    冲刺!
    冲刺!
    冲刺!
  • 原文地址:https://www.cnblogs.com/shilei/p/1027953.html
Copyright © 2011-2022 走看看