Server Error in '/' Application.

Specified cast is not valid.

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.InvalidCastException: Specified cast is not valid.

Source Error:


Line 138:
Line 139:    DateTime Creationdate = DateTime.MinValue;
Line 140:    if ((DateTime)newDT.Rows[0]["Creationdate"] != null && ((DateTime)newDT.Rows[0]["Creationdate"]).Year != 1900)
Line 141:    {
Line 142:        Creationdate = ((DateTime)newDT.Rows[0]["Creationdate"]);

Source File: d:\inetpub\vhosts\zesaaorg-1490.package\zesaa.org\wwwroot\company-profile.cshtml    Line: 140

Stack Trace:


[InvalidCastException: Specified cast is not valid.]
   ASP._Page_company_profile_cshtml.Execute() in d:\inetpub\vhosts\zesaaorg-1490.package\zesaa.org\wwwroot\company-profile.cshtml:140
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +185
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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