Kiran Kumari

Kiran Kumari

  • NA
  • 142
  • 12.9k

I have got error in MVC?

Jun 18 2019 2:57 AM
hi everyone
 
i want to get data from my storeprocedure i am calling but i get this message
 
The data reader is incompatible with the specified 'SH_SDTModel.SP_DashBoardReports_Result'. A member of the type, 'SNo', does not have a corresponding column in the data reader with the same name.
 
below are my code where i called this SP
  1. public IList<SP_DashBoardReports_Result> GetLblValues()    
  2. {  
  3.     SH_SDTEntities databaseee = new SH_SDTEntities();  
  4.     var data5 = databaseee.SP_DashBoardReports(Convert.ToDateTime("1/1/2019"), Convert.ToDateTime("6/1/2019"), "JobWiseStatus_SUM").ToList();  
  5.     if (data5 != null)  
  6.     {  
  7.         return data5;  
  8.     }  
  9.     else  
  10.         return null;  
  11. }  
i placed debugger and got error on this stage
  1. public virtual ObjectResult<SP_DashBoardReports_Result> SP_DashBoardReports(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo, string mode)    
  2. {    
  3.        var dateFromParameter = dateFrom.HasValue ?    
  4.                new ObjectParameter("DateFrom", dateFrom) :    
  5.                new ObjectParameter("DateFrom"typeof(System.DateTime));    
  6.        
  7.        var dateToParameter = dateTo.HasValue ?    
  8.                new ObjectParameter("DateTo", dateTo) :    
  9.                new ObjectParameter("DateTo"typeof(System.DateTime));    
  10.        
  11.        var modeParameter = mode != null ?    
  12.                new ObjectParameter("Mode", mode) :    
  13.                new ObjectParameter("Mode"typeof(string));    
  14.        
  15.        return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SP_DashBoardReports_Result>("SP_DashBoardReports", dateFromParameter, dateToParameter, modeParameter);    
  16. }   
how can i solve this can anyone solve this???

Answers (5)