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 52: 
Line 53:                 //var exh = (from ex in db.Exhibitors where ex.Company.Replace(" ", "-").Replace("&-", "").Replace("&", "-").Replace(".", "").Replace("'", "") == id select ex).FirstOrDefault();
Line 54:                 var exh = (from ex in db.Exhibitors where ex.RowId == Convert.ToInt32(id) select ex).FirstOrDefault();
Line 55:                 if (exh != null)
Line 56:                 {

Source File: d:\ASPX_Sites\HomeShowCenter\RemoReferrals.aspx    Line: 54

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +267
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +175
   lambda_method(Closure ) +102

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +122
   System.Delegate.DynamicInvokeImpl(Object[] args) +159
   System.Data.Linq.CommonDataServices.GetKeyFromPredicate(MetaType type, Dictionary`2 keys, Expression mex, Expression vex) +586
   System.Data.Linq.CommonDataServices.GetKeysFromPredicate(MetaType type, Dictionary`2 keys, Expression expr) +342
   System.Data.Linq.CommonDataServices.GetKeyValues(MetaType type, LambdaExpression predicate) +117
   System.Data.Linq.CommonDataServices.GetCachedObject(Expression query) +758
   System.Data.Linq.SqlClient.SqlProvider.GetCachedResult(Expression query) +75
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +104
   System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +50
   ASP.remoreferrals_aspx.Page_Load(Object sender, EventArgs e) in d:\ASPX_Sites\HomeShowCenter\RemoReferrals.aspx:54
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082


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