Server Error in '/' Application.

Conversion failed when converting the nvarchar value 'Jumping' to data type int.

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.Data.SqlClient.SqlException: Conversion failed when converting the nvarchar value 'Jumping' to data type int.

Source Error:


Line 24:     //Select * From (SELECT row_number() over (order by storypublishdate desc ) as rownumber, * FROM [dbo].[Stories]) as pageresults WHERE rownumber between 1100 and 1125 order by rownumbe
Line 25:     var SQL = "select * from (select Row_Number() over (ORDER BY PhotoID) as RowIndex, * from Photos WHERE  AlbumID = @0) as Sub Where Sub.RowIndex >= " + pagenum + " and Sub.RowIndex <" + (pagenum + Step) + " ORDER BY Sequence ASC ";
Line 26:     var data = db.Query(SQL, AlbumID);
Line 27:     var Count = "Select count(*) as nbr from Photos WHERE  AlbumID = @0";
Line 28:     var nbrx = db.QueryValue(Count,AlbumID);

Source File: C:\inetpub\wwwroot\UAEERF.ae\en\ShowPhotos.cshtml    Line: 26

Stack Trace:


[SqlException (0x80131904): Conversion failed when converting the nvarchar value 'Jumping' to data type int.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3321244
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +736
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4454
   System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +253
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +291
   System.Data.SqlClient.SqlDataReader.Read() +42
   System.Data.Common.DbEnumerator.MoveNext() +50
   WebMatrix.Data.<QueryInternal>d__0.MoveNext() +308
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +436
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +70
   WebMatrix.Data.Database.Query(String commandText, Object[] parameters) +131
   ASP._Page_en_ShowPhotos_cshtml.Execute() in C:\inetpub\wwwroot\UAEERF.ae\en\ShowPhotos.cshtml:26
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +182
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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