• 后台调用存储过程


     1 public JsonResult GetResult(string p_account_month_to)
     2 
     3 {
     4 
     5 SqlParameter[] param =
     6 
     7 {
     8 
     9 new SqlParameter("@p_org_info_id ", SqlDbType.Int),
    10 
    11 new SqlParameter("@p_customer_info_id ", SqlDbType.Int),
    12 
    13 new SqlParameter("@p_account_month_from", SqlDbType.VarChar, 6),
    14 
    15 new SqlParameter("@p_account_month_to", SqlDbType.VarChar, 6),
    16 
    17 new SqlParameter("@p_user_name", SqlDbType.VarChar, 50),
    18 
    19 new SqlParameter("@p_feedback", SqlDbType.VarChar, 500)
    20 
    21 };
    22 
    23 param[0].Value = base.org_info_id;
    24 
    25 param[1].Value = base.customer_info_id;
    26 
    27 param[2].Value = "";
    28 
    29 param[3].Value = p_account_month_to;
    30 
    31 param[4].Value = base.userName;
    32 
    33 param[5].Direction = ParameterDirection.Output;//返回的值
    34 
    35 using (EFContext context = new EFContext())
    36 
    37 {
    38 
    39 var results =
    40 
    41 context.Database.ExecuteSqlCommand(
    42 
    43 "fm_init_opening_balance @p_org_info_id,@p_customer_info_id ,@p_account_month_from,@p_account_month_to,@p_user_name,@p_feedback output",
    44 
    45 param[0], param[1], param[2], param[3], param[4], param[5]);
    46 
    47 context.Dispose();
    48 
    49 }
    50 
    51 var msg = param[5].Value;
    52 
    53 return Json(msg, JsonRequestBehavior.AllowGet);
  • 相关阅读:
    查询SQL的null与''
    JS不间断向上滚动代码
    JS不间断向左滚动代码
    Vcastr 3.0 flv player播放器
    网站W3C标准检测
    ASP.NET网站伪静态下使用中文URL
    Js禁止右键、禁止选中、禁止复制
    游标的使用
    触发器实例
    存储过程中新建临时表
  • 原文地址:https://www.cnblogs.com/guess/p/6168801.html
Copyright © 2020-2023  润新知