Data paging in SQL Server CE (Compact Edition)

前端 未结 5 1413
时光取名叫无心
时光取名叫无心 2021-01-11 12:56

I am writing a wpf destop application, and would like to use SQL Server CE as a backend. I\'m trying to come up with a good way to do efficient data paging. In SQL Server

5条回答
  •  借酒劲吻你
    2021-01-11 13:31

    Honestly, probably the fastest thing to do is use an SqlCeDataReader and call .Read() 10 times. Then when the user moves to the next page, you're already pointing at the 11th result, and can read 10 more. If you need to go backwards, you can either cache your results or switch to an SqlCeResultSet which supports seeking.

    Also, SqlCeDataReader/Result is, from experience, the absolute fastest way to interact with the database on the desktop. It can be literally 100 times faster than using DataSets/DataAdapters.

提交回复
热议问题