Iām using System.Data.SqlTypes.SqlDateTime.MinValue
and System.Data.SqlTypes.SqlDateTime.MaxValue
to define the range for Datetime and Date field using following lines of code.
[Range(typeof(DateTime), "1/1/1753 12:00:00 AM", "12/31/9999 11:59:59 PM", ErrorMessage="\'D2\' must be within 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.")]
public System.Nullable<System.DateTime> D2{get;set;}//;
But when I entered date 11/08/2016 12:00 am
into textbox it throws an error message
'D2' must be within 1/1/1753 12:00 AM and 12/31/9999 11:59 PM.
So please let me know what wrong in above code.