search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Your example throws an error

Asked by Anonymous
12 years ago.

I am looking for basically what dayplot is.
I get the dll to try it out. I copy and paste the example EXACTLY - which throws an exception...

Seriously - first point of contact for your new customers and you basically can't be bothered making sure the most basic first code example actually runs??

It is data binding example from here:
http://www.daypilot.org/data-binding.html

Exception throw:

[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +3610402
System.Convert.ToDateTime(String value) +83
DayPilot.Web.Ui.DayPilotCalendar.PerformDataBinding(IEnumerable retrievedData) +747
DayPilot.Web.Ui.DayPilotCalendar.OnDataSourceViewSelectCallback(IEnumerable retrievedData) +73
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
DayPilot.Web.Ui.DayPilotCalendar.PerformSelect() +131
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
About.Page_Load(Object sender, EventArgs e) in c:\Users\Eli\Documents\Visual Studio 2010\WebSites\WebSite1\About.aspx.cs:29
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Answer posted by Anonymous
12 years ago.

Found the problem

open source code.
change this to remove the null in the first 2 lines (line 866 in DayPilotCalendar.cs) and then recompile . and use that dll for ur other project.

DateTime start = Convert.ToDateTime(DataBinder.GetPropertyValue(dataItem, DataStartField, null));
DateTime end = Convert.ToDateTime(DataBinder.GetPropertyValue(dataItem, DataEndField, null));
string name = Convert.ToString(DataBinder.GetPropertyValue(dataItem, DataTextField, null));
string pk = Convert.ToString(DataBinder.GetPropertyValue(dataItem, DataValueField, null));

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.