Store Procedure not return value in MVC5

前端 未结 1 1858
故里飘歌
故里飘歌 2020-12-18 16:18

I am working in MVC5 with Entity Framework through db approach. I use Mysql as database. I create a procedure and when Call Procedure in Mysql it work as my

相关标签:
1条回答
  • 2020-12-18 17:22

    i solve this problem by myself. I make changed in store procedure and action method.

    I add one more parameter in my procedure as OUTPUT and store return value in this variable.

    OUT Flag int
    
    SET Flag=0;
    SELECT Flag;
    

    Then make change in action method.

    String format = "yyyy-MM-dd hh:mm:ss";
    System.Data.Entity.Core.Objects.ObjectParameter flag = new System.Data.Entity.Core.Objects.ObjectParameter("flag", typeof(int));
    var status = db.checkSeasonAvailability(hotelSeasonId,seasonId, hotelId, startDate.ToString(format), endDate.ToString(format), flag);
    
    0 讨论(0)
提交回复
热议问题