Nizam Nizam

Nizam Nizam

  • NA
  • 32
  • 20.1k

what is this error in mvc4

Mar 6 2015 11:47 PM
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 38: @foreach (var divcls in dc)
Line 39: {
Line 40: var students = Model.Where(S => S.Stud_Status.FirstOrDefault(A => A.AcademicYearId == SessionValues.Current.AcademicYear.AcademicYearId).Sett_DivisionsInClasses.DivInClassId == divcls.DivInClassId).ToList();
Line 41: var Btotal = students.Count(b => b.Gender == "M");
Line 42: var Ftotal = students.Count(f => f.Gender == "F");

Answers (2)