This is a migrated thread and some comments may be shown as answers.

Jquery KendoUI datepicker SqlDateTime overflow in the grid

1 Answer 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Davis
Top achievements
Rank 1
Davis asked on 11 Mar 2020, 12:28 AM

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
public~

...

DateTime datevalue;

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

DateTime effectiveDate = datevalue;

...

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 12 Mar 2020, 07:02 PM

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.

Regards,
Hetali
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.
Tags
General Discussions
Asked by
Davis
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or