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 130:        GridView1.DataBind()
Line 131:      Else
Line 132:                SQLDataSource.SelectCommand = "SELECT * FROM tblDocuments where CID=" & CInt(Request("i")) & " ORDER BY DateAdded DESC "
Line 133:        GridView1.DataBind()
Line 134:      End If

Source File: C:\inetpub\wwwroot\NCEDA\Downloads.aspx.vb    Line: 132

Stack Trace:


[FormatException: Input string was not in a correct format.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) +204
   Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +99

[InvalidCastException: Conversion from string "Nceda - Annual Report 2011.pdf" to type 'Integer' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +257
   News.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\NCEDA\Downloads.aspx.vb:132
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.5477; ASP.NET Version:2.0.50727.5483