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 101:
Line 102:
Line 103:        Dim reader As Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
Line 104:        reader.Read()
Line 105:        Dim totalRows As Integer = reader("totalRows").ToString()

Source File: C:\Inetpub\vhosts\babalqasr.com\httpdocs\VideoGalleryAlbumList.aspx.vb    Line: 103

Stack Trace:


[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12724149
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +120
   System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46
   System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +483
   System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) +1280

[FormatException: Failed to convert parameter value from a String to a Int32.]
   System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming) +1325
   System.Data.SqlClient.SqlParameter.GetCoercedValue() +180
   System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc) +165
   System.Data.SqlClient.SqlCommand.BuildParamList(TdsParser parser, SqlParameterCollection parameters, Boolean includeReturnValue) +201
   System.Data.SqlClient.SqlCommand.BuildExecuteSql(CommandBehavior behavior, String commandText, SqlParameterCollection parameters, _SqlRPC& rpc) +241
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2598
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +1483
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +64
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +161
   System.Data.SqlClient.SqlCommand.ExecuteReader() +99
   VideoGalleryAlbumList.getPageNumber(Int32 pageSize) in C:\Inetpub\vhosts\babalqasr.com\httpdocs\VideoGalleryAlbumList.aspx.vb:103
   VideoGalleryAlbumList.GetDetails() in C:\Inetpub\vhosts\babalqasr.com\httpdocs\VideoGalleryAlbumList.aspx.vb:84
   VideoGalleryAlbumList.Page_Load(Object sender, EventArgs e) in C:\Inetpub\vhosts\babalqasr.com\httpdocs\VideoGalleryAlbumList.aspx.vb:14
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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