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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek YadavPosted Nov 28, 2022, 8:16 AM
set page mappings
Bozo SkopljakovicPosted Nov 27, 2022, 11:35 AM
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