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 31: 
Line 32:         string t = Request.QueryString["type"].ToString();
Line 33:         DataSet ds = Library.PageNTS.NoiDungListNT.getData(Convert.ToInt16(t), pageSize,pageIndex);
Line 34:         int tongSoBangGhi = Convert.ToInt16(ds.Tables[1].Rows[0][0]);
Line 35:         rptList.DataSource = ds.Tables[0];

Source File: d:\vhosts\nhatthanh.net\httpdocs\noidung_list.aspx.cs    Line: 33

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.Int16.Parse(String s, NumberStyles style, NumberFormatInfo info) +39
   System.Convert.ToInt16(String value) +63
   noidung_list.Page_Load(Object sender, EventArgs e) in d:\vhosts\nhatthanh.net\httpdocs\noidung_list.aspx.cs:33
   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