I tried your code from this site,
it works fine while ID ORDER data is ASCE but when I try sort as DESC I am not able to get first page with last ID,
is ther any way to make this thanks
I tried your code from this site,
it works fine while ID ORDER data is ASCE but when I try sort as DESC I am not able to get first page with last ID,
is ther any way to make this thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bozo Skopljakovic141 reputationPosted Nov 27, 2022, 6:35 AM EST
I solved it this way,
your code was "string str = "select * from Table1 where id between "+pageIndex+" and "+PageSize"
and it works fine if you want to see ordered data ascending but if you want descending order this not working.
I changed litle bit this in to
"SELECT * FROM (SELECT firstname, lastname, personid, ROW_NUMBER() OVER (ORDER BY personid DESC) FROM tblperson ) AS tabele2 WHERE tabele2.ROW_NUMBER BETWEEN " + pageIndex + " AND " + PageSize + "ORDER BY ROW_NUMBER";
Now we can see first last entered data in database
Abhishek YadavRank #217 · 11.3K reputationPosted Nov 28, 2022, 3:16 AM EST
set page mappings