2

Since SKIP clause is not supported by SQL Server Compact 3.5 is there any way to accomplish paging?

EDIT:

To accomplish paging in Sql CE using only EF is not possible right now, Visual Studio 2010 SP1 will add SQL CE 4 and an update to EF 4 in order to make SKIP work like in SQL Server 2008. I just hope SP1 will be available soon :)

Kamyar Nazeri
  • 25,786
  • 15
  • 50
  • 87
Stefan P.
  • 9,489
  • 6
  • 29
  • 43

1 Answers1

1

Offset and Fetch seem to be supported in SQL Server Compact 4

http://www.mikesdotnetting.com/Article/150/Web-Pages-Efficient-Paging-Without-The-WebGrid

That might not help you though:

Often paging is accomplished with the ROW_NUMBER() function.

SELECT field1 ,field2
FROM     (SELECT ROW_NUMBER() OVER (ORDER BY field1 ASC)
             AS Row, field1 ,field2  FROM table 
WHERE field1.name = 'foo')
            AS table
WHERE  Row >= 299 AND Row <= 355

But I'm not sure if thats supported in CE: Here's an existing thread:

Data paging in SQL Server CE (Compact Edition)

Community
  • 1
  • 1
Matt Evans
  • 7,113
  • 7
  • 32
  • 64
  • SQL Server Compact 4 is CTP and I just cant ship a product with beta components... ROW_NUMBER() is not supported under SQL CE 3.5... – Stefan P. Nov 23 '10 at 13:53