Popular Posts
Redirect webpart in sanboxed solution using System; using System.ComponentModel; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebCo... Page load event handler on sharepoint <script type="text/javascript">     _spBodyOnLoadFunctionNames.push("onPageLoadAction");     function onPageLoadA... Fix for SharePoint 2010 scrolling problems for Chrome Execute on page loaded function bodyOnLoadWrapperForChrome() {     //verify we have finished loading init.js     if (typeof (_spBodyOnLoadW...
Stats
Data Paging
Sql Server 2005
DECLARE @PageIndex INT;
DECLARE @PageSize INT;
SET @PageSize = 3;
SET @PageIndex = 1;

DECLARE @StartIndex INT;
DECLARE @EndIndex INT;
SET @StartIndex = @PageSize * (@PageIndex-1) +1;
SET @EndIndex = @StartIndex + @PageSize - 1;


WITH ProductEntires AS(
    SELECT 
        ROW_NUMBER() OVER (ORDER BY [UpdateDate] DESC) AS RowIndex, 
        [ID], 
        [ProductName], 
        [ProductDescription], 
        [ProductImage1], 
        [ProductTitle1], 
        [VotedAmount] 
    FROM 
        [TblProduct] 
)

SELECT * 
FROM ProductEntires
WHERE
    [RowIndex] BETWEEN @StartIndex AND @EndIndex