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

I got an error .. " Unable to convert '' (from DataStartField column) to DateTime."

Asked by Rose
12 years ago.

I used DayPilotmonth for my calendar. I used to work well, but today i got a problem Unable to convert '' (from DataStartField column) to DateTime. While another pages which was coded at the same statement does not have any problem. I have used trial version for my final class project. Is there anyway to slove the problem. This problem was occured when my webpage was loading.

PS. I am coding by using ASP.Net and C#

Best regards,
Rose

Comment posted by Steve M.
12 years ago.

What is the actual value you are trying to convert? Are you passing in a nullable datatype?

Answer posted by Dan Letecky [DayPilot]
12 years ago.

Steve is right: You should check the values in this column. It looks like one of the values is null.

DayPilot uses the following code to get the DateTime value from the DataStartField column:

            string strStart = DataBinder.GetPropertyValue(dataItem, DataStartField, null);
            if (!DateTime.TryParse(strStart, out start))
            {
                throw new FormatException(String.Format("Unable to convert '{0}' (from DataStartField column) to DateTime.", strStart));
            }


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