I add an object to the list in an ASP.NET MVC 3 application using the following code, but one of the properties of the object creates difficulties.
ls.Add(new UserRoleModel { UserRoleId = 1, UserName = "Paul", InsertDate = new DateTime(05, 24, 2012),InsertProgram="sqlplus",InsertUser="sp22",Role="Implementation Co-corindator"});
This builds, but when I go to the corresponding page, I get an exception with the following type:
Exception Details: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
I tried to remove 0 per month, but get the same exception.
source
share