Server Error in '/' Application.

Input string was not in a correct format.

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: Input string was not in a correct format.

Source Error:


Line 45:               + " LEFT JOIN [EEF].[eefsys].[EventStatus] as e on a.Status = e.Code"
Line 46:               + " Where a.Code = @0 ";
Line 47:         var data = db.QuerySingle(sqlQ, Convert.ToInt32(id));
Line 48:         var Ename = "";
Line 49: 

Source File: C:\inetpub\wwwroot\UAEERF.ae\ar\Content\Endurance\RideInfo.cshtml    Line: 47

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14524712
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +172
   System.Convert.ToInt32(String value) +60
   ASP._Page_ar_Content_Endurance_RideInfo_cshtml.Execute() in C:\inetpub\wwwroot\UAEERF.ae\ar\Content\Endurance\RideInfo.cshtml:47
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +182
   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.7.3930.0