how to create Google like custom paging using Stored Procedure IN ASP.NET CORE . I have below Stored Procedure.
CREATE PROCEDURE PagedResults_New
(
@startRowIndex int,
@maximumRows int
)
AS
DECLARE @tmp TABLE
(
ID int ,
AccountNo char(30),
Amount decimal (18,2)
)
-- Insert the rows from tblItems into the temp. table
INSERT INTO @tmp (ID,AccountNo , Amount)
SELECT No,AccountNo,Amount
FROM tbl1
-- Now, return the set of paged records
SELECT e.*
FROM @tmp t INNER JOIN tbl1 e ON
e.No = t.ID
WHERE ID BETWEEN (@startRowIndex * @maximumRows) + 1 AND (@startRowIndex * @maximumRows) + @maximumRows
GO
you will have to use SQL function row_number or dense to fetch only required data.
select col1, col2, col3
from
(SELECT e.col1, e.col2, e.col3, ROW_NUMBER() OVER(ORDER BY ID ASC) as [rownumber]
FROM @tmp t INNER JOIN tbl1 e ON
e.No = t.ID
) as data
where rownumber> @FirstRow AND
rownumber< @LastRow
Member
46 Points
180 Posts
Custom Paging
Jan 19, 2021 06:44 AM|jagjit saini|LINK
Hi
how to create Google like custom paging using Stored Procedure IN ASP.NET CORE . I have below Stored Procedure.
CREATE PROCEDURE PagedResults_New ( @startRowIndex int, @maximumRows int ) AS DECLARE @tmp TABLE ( ID int , AccountNo char(30), Amount decimal (18,2) ) -- Insert the rows from tblItems into the temp. table INSERT INTO @tmp (ID,AccountNo , Amount) SELECT No,AccountNo,Amount FROM tbl1 -- Now, return the set of paged records SELECT e.* FROM @tmp t INNER JOIN tbl1 e ON e.No = t.ID WHERE ID BETWEEN (@startRowIndex * @maximumRows) + 1 AND (@startRowIndex * @maximumRows) + @maximumRows GO
Thanks
Contributor
3550 Points
922 Posts
Re: Custom Paging
Jan 19, 2021 01:54 PM|l.laxmikant|LINK
you will have to use SQL function row_number or dense to fetch only required data.
for detailed steps visit - https://geeksarray.com/blog/repeater-control-and-database-level-paging