Limiting # of Rows in SQLCE Select

  • Thread starter Thread starter Jim Wilson [eMVP]
  • Start date Start date
J

Jim Wilson [eMVP]

This is a pretty low-tech solution but you could split your second example
into two parts.
 
Ok, it appears the Top keyword doesn't work in SQLCE, nor does subselect
statements in the where clause. Is it possible to limit the number of
records returned by the query?

Two examples that don't work:

select top 1 * from setup order by createdate desc;
select * from setup where createdate = (select max(createdate) from setup);

Thanks,
 
If you are using an SqlCeDataReader to read the data you can keep count of
the rows you have read and close the reader once you have enough.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
 
Back
Top