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].

References:

[1] – https://msdn.microsoft.com/en-us/library/bb445504.aspx

[2] – https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application

[3] – https://msdn.microsoft.com/en-us/library/bb738702(v=vs.100).aspx

Advertisements