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 16: 
Line 17:         var cmnts = from c in db.Blog_Comments where c.MessageID == Convert.ToInt32(Request.QueryString["id"].ToString()) && c.Authorized == true select c;
Line 18:         var blg = (from b in db.Blog_Messages where b.MessageID == Convert.ToInt32(Request.QueryString["id"].ToString()) select b).SingleOrDefault();
Line 19:         Page.Title = blg.Title;
Line 20:         HtmlMeta headTag1 = new HtmlMeta();

Source File: D:\ASPX_Sites\Gift&ArtExpo\blog\weblog.aspx    Line: 18

Stack Trace:


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

[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) +269
   System.Delegate.DynamicInvokeImpl(Object[] args) +160
   System.Data.Linq.CommonDataServices.GetKeyFromPredicate(MetaType type, Dictionary`2 keys, Expression mex, Expression vex) +565
   System.Data.Linq.CommonDataServices.GetKeysFromPredicate(MetaType type, Dictionary`2 keys, Expression expr) +330
   System.Data.Linq.CommonDataServices.GetKeyValues(MetaType type, LambdaExpression predicate) +114
   System.Data.Linq.CommonDataServices.GetCachedObject(Expression query) +730
   System.Data.Linq.SqlClient.SqlProvider.GetCachedResult(Expression query) +72
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +107
   System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +51
   ASP.blog_weblog_aspx.Page_Load(Object sender, EventArgs e) in D:\ASPX_Sites\Gift&ArtExpo\blog\weblog.aspx:18
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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