Jump to content

Changing sorting order in pagination class


saynotojava

Recommended Posts

16 hours ago, requinix said:

If you can't sort in the query then you have to retrieve all the data and do all the work yourself. And that is a terrible thing to be forced into.

Why do you say you can't do it in a query?

It's a specific query in specific situation which require order by NULL to make it work properly. It does sounds like a terrible thing, but since i have this class already, it should be possible to reverse page output, so page 1 become page 10,page 2 become 9 and so on.

Link to comment
Share on other sites

27 minutes ago, requinix said:

But... if it's already sorting by the correct criteria just in the wrong order, then all you have to do is reverse the order.

What's your code? Maybe it will be easier to understand your problem if we can see that.

There is not much difference between example code and my code, only difference is sql query and obviously HTML layout. Everything else is same as in example code.

Link to comment
Share on other sites

7 minutes ago, Barand said:

Apparently SQLServer queries involving ROW_NUMBER column in the output requires an ORDER BY to be specified, even if it is a dummy one like "ORDER BY NULL". This could be one of those situations, but at the moment it's just speculation.

Actually,  when i tested different queries,  when you dont specify ORDER in query, by default it order by ID(alias first column). So if you dont want ORDER to run , then you need to specify NULL.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.