C#执行带返回值的储存过程

        /// <summary>
        /// 获得DATASET数据列表
        /// </summary>
        public DataSet GetListOutParm(string strWhere,ref StringBuilder suc)
        {
            SqlParameter[] parameters = {
     new SqlParameter("@JG_NAME", SqlDbType.VarChar,50),
                     new SqlParameter("@sucess", SqlDbType.VarChar,50)
            };
            parameters[0].Value = "%%";
            parameters[1].Direction = ParameterDirection.Output;
            DataSet ds = DbHelperSQL.RunProcedure("UP_HIS_JGXX_GetList", parameters, "ds");
            string sucess = Convert.ToString(parameters[1].Value);
            suc = new StringBuilder(1024);
            suc.Append(sucess);
            return ds;
        }

        /// <summary>
        /// 返回参数
        /// </summary>
        public string  GetOutParm()
        {
            SqlParameter[] parameters = {
     new SqlParameter("@JG_NAME", SqlDbType.VarChar,50),
                     new SqlParameter("@sucess", SqlDbType.VarChar,50)
            };
            parameters[0].Value = "%%";
            parameters[1].Direction = ParameterDirection.Output;
            DataSet ds = DbHelperSQL.RunProcedure("UP_HIS_JGXX_GetList", parameters, "ds");
            return Convert.ToString(parameters[1].Value); ;
        }

你可能感兴趣的:(返回值)