Gcobani Mkontwana

Gcobani Mkontwana

  • 560
  • 1.9k
  • 411.2k

System.InvalidOperationException

Sep 22 2020 3:11 AM
Hi Team
 
I have this following  model, every time i am trying to run my controller its complain about the data type being non-null value be set to System.Int32. How do i solve this issue? this data type is set as float type.
  1. public ActionResult SearchPeopleDetails()  
  2. {  
  3.              
  4.     RegCoursesViewModel regCoursesView = new RegCoursesViewModel();  
  5.     return View(cb.RegPeopleLists.ToList());  // Exception is here by run time.
  6. }  
  7.   
  8. public class eNtsaRegPeopleLists  
  9. {  
  10.     public string Name { getset; }  
  11.     [Key]  
  12.     public int LoginID { getset; }  
  13.     public string SISID { getset; }  
  14.     public string Role { getset; }  
  15.     public DateTime LastActivity { getset; }  
  16.     public int? TotalActivity { getset; } // I did this before public float TotalActivity {get;set;}

Answers (1)