Browsed some codes, and found a customized DataPager control. This codes behind this DataPager basically go down to database, fetch all the rows, filter the rows based on searching parameters in the memory, and display rows to UI based on page size. Amazingly, it still works due to small size of all data rows returned.

What happens if we have a million rows? thinking face

It is bad practice, and not scalable. It is not difficult to implement a paging inside the database [1]. If you use LINQ and Entity Framework, it is even easier [2][3].


[1] –

[2] –

[3] –