DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » General » String was not recognized as a valid DateTime.

String was not recognized as a valid DateTime.

I am receiving the following error when attemping to run a page with the Scheduler control on it:
String was not recognized as a valid DateTime.

I have the DataSourceID set to an ObjectDataSource which returns data from a table adapter.The DataStartField and DataEndField are set to columns in the database that are of type DateTime. Is there some specific format that the date properties are looking for?

Anonymous - 8/29/2007 3:46:54 PM
The input data for start and end columns are converted to DateTime using Convert.ToDateTime(). Can you post the exception stack trace?
Dan Letecky - 8/29/2007 9:53:04 PM

String was not recognized as a valid DateTime.

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.FormatException: String was not recognized as a valid DateTime.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2228162
System.DateTime.Parse(String s, IFormatProvider provider) +26
System.Convert.ToDateTime(String value) +86
DayPilot.Web.Ui.DayPilotScheduler.PerformDataBinding(IEnumerable retrievedData) +617
DayPilot.Web.Ui.DayPilotScheduler.OnDataSourceViewSelectCallback(IEnumerable retrievedData) +61
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
DayPilot.Web.Ui.DayPilotScheduler.PerformSelect() +110
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +19
DayPilot.Web.Ui.DayPilotScheduler.OnPreRender(EventArgs e) +33
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

Anonymous - 8/29/2007 10:38:12 PM
I've added custom exception handling for loading DataStartField and DataEndField values. It shows what string was causing the problem in the exception message.
This fix will be included in the next release. If you want to test it now, contact me at daypilot @ annpoint.com and I will send it to you.
Dan Letecky - 8/30/2007 9:33:25 AM
Ok, I sent you an email. Thanks!
Anonymous - 8/30/2007 2:43:17 PM

Has this issue been fixed in newest version, DayPilot Pro 5.0?

Anonymous - 10/6/2008 4:36:59 PM

This error will happen when you try to assign a database column with values that are not convertible to DateTime to either DataStartField or DataEndField.

Please let me know if you believe the problem is somewhere else.

Dan Letecky - 10/6/2008 7:22:43 PM
Post reply