Click or drag to resize
DynamicQueryEngineManglePageSelectDQ2005 Method
Creates a CTE using paging query for SqlServer 2005 or higher.

Namespace: SD.LLBLGen.Pro.DQE.SqlServer
Assembly: SD.LLBLGen.Pro.DQE.SqlServer (in SD.LLBLGen.Pro.DQE.SqlServer.dll) Version: 5.0.0.0 (5.0.0)
Syntax
protected virtual void ManglePageSelectDQ2005(
	IRetrievalQuery selectQuery,
	IEntityFieldCore[] selectList,
	IFieldPersistenceInfo[] fieldsPersistenceInfo,
	int rowsToSkip,
	int rowsToTake
)

Parameters

selectQuery
Type: SD.LLBLGen.Pro.ORMSupportClassesIRetrievalQuery
the actual query to page over.
selectList
Type: SD.LLBLGen.Pro.ORMSupportClassesIEntityFieldCore
The select list.
fieldsPersistenceInfo
Type: SD.LLBLGen.Pro.ORMSupportClassesIFieldPersistenceInfo
The fields persistence info.
rowsToSkip
Type: SystemInt32
The rows to skip.
rowsToTake
Type: SystemInt32
The rows to take.
Remarks
Query structure:
            WITH __actualSet AS
            (
            SELECT *, ROW_NUMBER() OVER(ORDER BY CURRENT_TIMESTAMP) AS __rowcnt
            FROM
            (
            -- if rowsToTake > 0
            SELECT DISTINCT TOP (rowsToSkip + rowsToTake), projection of selectQuery
            -- else (as the complete set to fetch has to be selected, there's no upper limited.
            selectQuery
            ) AS _tmpSet
            )
            SELECT selectlist FROM __actualSet
            WHERE __rowcnt BETWEEN startCnt AND endCount
            ORDER BY __rowcnt ASC
            
And sortclause refers to the fields in the _tmpSet, instead of having the full order by again.
See Also