Use the offset and fetch next to paginate.
Grid-view paging using .net MVC core with SQL stored procedure
I am new to .net core mvc what is best way to do Grid-view paging using .net MVC core with SQL stored procedure
Developer technologies ASP.NET ASP.NET Core
3 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2024-10-25T18:23:36.9933333+00:00 -
SurferOnWww 4,706 Reputation points
2024-10-27T01:14:34.6166667+00:00 Is the "Grid-view" mentioned in your question the GridView control available in the ASP.NET Web Forms application?
My means grid table not grid view.
I recommend that you follow the following Microsoft tutorial as introduced by @AgaveJoe in the comment above.
Tutorial: Add sorting, filtering, and paging - ASP.NET MVC with EF Core
As for a use of ADO.NET and stored procedure, it is not practical if you need not only paging but also sorting and filtering which are shown in the tutorial. Therefore, I suggest that you use the EF Core and linq to Entities as described in the tutorial.
Please let me know if you do not need the sorting and filtering.
-
SurferOnWww 4,706 Reputation points
2024-10-27T01:14:56.54+00:00 deleted as duplicated