Jquery KendoUI datepicker SqlDateTime overflow in the grid

2 posts, 0 answers
  1. Davis
    Davis avatar
    1 posts
    Member since:
    May 2019

    Posted 10 Mar Link to this post

    I've added a kendo date picker as an editor in the grid and when I pick a date and click save changes, I get an sql error message: "SqlDateTime overflow.Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM". (Data type in sql is DateTime2). I think I parsed it in a right format (MM/dd/yyyy), but I'm not sure why its not working. When I manually type it as a string type (e.g. 3/7/2020), it works just fine.


    1. Grid column part
    columns: [{field: "EffectiveDate", title:"EffDate", template: "#= kendo.toString(kendo.parseDate(data.EffectiveDate, 'yyyy-MM-ddThh:mm:ss'), 'MM/dd/yyyy')#", width: 50, editor: CustomDatePicker}]


    2. Editor part
    function CustomDatePicker(container, options) { $('<input required name="' + options.field + '"/>').appendTo(container).kendoDatePicker({ format: "MM/dd/yyyy", max: new Date(), parseFormats: ["MM/dd/yyyy"]});}


    3. Controller part -- when I'm debugging, the breakpoint hits here and give an sql overflow


    DateTime datevalue;

    bool? isOk; isOk = DateTime.TryParse(HttpContext.Current.Request.Form["EffectiveDate"].ToString(), out datevalue);

    DateTime effectiveDate = datevalue;


  2. Hetali
    Hetali avatar
    26 posts

    Posted 12 Mar Link to this post

    Hi Min-Ho,

    Thank you for the detailed information.

    Upon replicating the issue with the snippets provided by you, I could not see any error on my end as seen in this Dojo example.

    I believe that the error is caused by the SQL database. As SQL is not a Progress technology, we do not provide resources for troubleshooting problems with SQL and ultimately falls outside the scope of support.  

    That being said, I bent those rules a little and did some preliminary research to help point you in the right direction:
    • Microsoft ASP.NET Forum - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM
    • Stack Overflow - Error - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM

    If you feel that the error is caused by the Kendo UI Grid, please update the Dojo sample such that it replicates the issue observed by you. I will further investigate.

    Please let me know if I can further help you with this case.

    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top