Server Error in '/' Application.

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:


Line 126:                        else
Line 127:                        {
Line 128:                            eventsTextHeader = eventsTextHeader + " " +  " to " + String.Format("{0:MMMM d}", MyDataReader["endDate"]).ToString() + ", " + String.Format("{0:h:mm tt}", DateTime.Parse(MyDataReader["startTime"].ToString())).ToString() + " - " + String.Format("{0:h:mm tt}", DateTime.Parse(MyDataReader["endTime"].ToString())).ToString();
Line 129:                        }
Line 130:                    }

Source File: d:\inetpub\wwwroot\FAITHNETWORK_VAULT\FAITHNETWORK\TEMPLATESITES\BASECODE\eventCalendarDetails.aspx.cs    Line: 128

Stack Trace:


[FormatException: String was not recognized as a valid DateTime.]
   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +14545182
   _Default.Page_Load(Object sender, EventArgs e) in d:\inetpub\wwwroot\FAITHNETWORK_VAULT\FAITHNETWORK\TEMPLATESITES\BASECODE\eventCalendarDetails.aspx.cs:128
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4063.0