获取存储过程输出参数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq389216533/article/details/51793466
public string UpdateStockINCheck(StockStockIN model)
        {
            string bResult = "";
            int count = 0;
            try
            {
                // 创建参数 
                SqlParameter[] parameters = {
                 new SqlParameter("@Operator", SqlDbType.VarChar,20) ,
                 new SqlParameter("@BillID", SqlDbType.Int) ,
                 new SqlParameter("@bResult", SqlDbType.VarChar,200) ,
             };
                // 设置参数类型 
                parameters[0].Value = model.Operator;
                parameters[1].Value = model.StockINID;
                parameters[2].Direction = ParameterDirection.Output;  // 设置为输出参数 


                SqlHelper.ExNonQuery(wdgj31sqlcon, System.Data.CommandType.StoredProcedure, "G_StockINBill_Exec", parameters);
                bResult = parameters[2].Value.ToString();
            }
            catch (Exception ex)
            {


            }


            return bResult;


        }

猜你喜欢

转载自blog.csdn.net/qq389216533/article/details/51793466
今日推荐