zoukankan      html  css  js  c++  java
  • SQL Server 输出参数OUTPUT

    ALTER PROCEDURE [dbo].[SearchActivity]
    (
          @Counts int = 0 OUTPUT  
    )
    AS
    SET NOCOUNT ON;

    ….

    public static DataSet Search(ref int Counts)
            {
                    string strConnect = CoBro.Common.AppConfig.ConnectString;
                    SqlConnection sqlConnection = new SqlConnection(strConnect);
                    SqlDataAdapter da = new SqlDataAdapter();

                    SqlCommand cmd = new SqlCommand("SearchActivity", sqlConnection);
                    cmd.CommandType = CommandType.StoredProcedure;
                    da.SelectCommand = cmd;
                    SqlParameter para;               

                    para = cmd.Parameters.Add("@Counts", SqlDbType.Int);
                    para.Direction = ParameterDirection.Output;

                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    Counts = Convert.ToInt32(cmd.Parameters["@Counts"].Value);
                    sqlConnection.Close();
                    return ds;             
            }

  • 相关阅读:
    dubbox编译
    fastdfs的启动停止
    fastDFS单机
    Dsu on tree算法
    The 2017 ACM-ICPC Asia Beijing Regional Contest(重现赛)
    2019南京ICPC(重现赛) F
    Codeforces Round #634 (Div. 3)
    Codeforces Round #632 (Div. 2)
    HDU 6521 Party(线段树)
    牛客小白月赛20
  • 原文地址:https://www.cnblogs.com/emanlee/p/1649498.html
Copyright © 2011-2022 走看看