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 49:         SqlCommand sqlcmd = new SqlCommand("news_getAll_Id_npic", core.Prip);
Line 50:         sqlcmd.CommandType = CommandType.StoredProcedure;
Line 51:         sqlcmd.Parameters.Add("@news_id", SqlDbType.Int).Value = int.Parse(tb_id.Text);
Line 52:         System.Data.SqlClient.SqlDataReader ctecka = sqlcmd.ExecuteReader();
Line 53: 

Source File: d:\v025330\aisan.cz\WWWRoot\Aktuality.aspx.cs    Line: 51

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +13033687
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +122
   System.Int32.Parse(String s) +26
   Aktuality.nactiFotos() in d:\v025330\aisan.cz\WWWRoot\Aktuality.aspx.cs:51
   Aktuality.Page_Init(Object sender, EventArgs e) in d:\v025330\aisan.cz\WWWRoot\Aktuality.aspx.cs:192
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnInit(EventArgs e) +97
   System.Web.UI.Page.OnInit(EventArgs e) +14
   System.Web.UI.Control.InitRecursive(Control namingContainer) +142
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +416


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