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:         //title
Line 46:         ServiceDAL serDAL = new ServiceDAL();
Line 47:         service ser = serDAL.FindByCondition(c => c.id.Equals(id)).FirstOrDefault();
Line 48:         ser.views += 1;
Line 49:         serDAL.SubmitChange();

Source File: d:\vhosts\khangthanh.com\httpdocs\servicesdetail.aspx.cs    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) +7687831
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46
   System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +373
   System.Data.Linq.DBConvert.ChangeType(Object value, Type type) +3439
   System.Data.Linq.SqlClient.Visitor.CoerceBinaryArgs(SqlExpression& arg1, SqlExpression& arg2) +255
   System.Data.Linq.SqlClient.Visitor.VisitBinaryOperator(SqlBinary bo) +510
   System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node) +196
   System.Data.Linq.SqlClient.SqlVisitor.VisitExpression(SqlExpression exp) +8
   System.Data.Linq.SqlClient.SqlVisitor.VisitSelectCore(SqlSelect select) +46
   System.Data.Linq.SqlClient.SqlVisitor.VisitSelect(SqlSelect select) +20
   System.Data.Linq.SqlClient.SqlVisitor.Visit(SqlNode node) +1024
   System.Data.Linq.SqlClient.SqlProvider.BuildQuery(ResultShape resultShape, Type resultType, SqlNode node, ReadOnlyCollection`1 parentParameters, SqlNodeAnnotations annotations) +718
   System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations) +161
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +137
   System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +31
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +7893590
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +57
   ServiceDAL.FindByCondition(Expression`1 WhereClause) +46
   servicesdetail.seo() in d:\vhosts\khangthanh.com\httpdocs\servicesdetail.aspx.cs:47
   servicesdetail.Page_Load(Object sender, EventArgs e) in d:\vhosts\khangthanh.com\httpdocs\servicesdetail.aspx.cs:18
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2602


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062