Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Could you please provide solution for alphanumeric sorting using iqueryable.
I am using mysql as database.

I want to sort them in the database only. I dont want to sort them in the memory.

Regards,
Santosh

What I have tried:

I have tried it is possible to use the icomparer for alphanumeric sort but it does not work with iqueryable .
With icomparer, we can do it with in memory.
But my requirement is to sort the records alphanumerically in the database itself.
Posted
Updated 30-Oct-18 20:33pm

1 solution

You don't sort anything in a database: you use SQL ORDER BY clauses as part of the SELECT operation to specify the sort order when they are extracted from the database to feed your presentation software.

Data in a DB is stored according to the hashing algorithm used to provide efficient access to the INDEXed rows, such as the table Primary Key. You can't directly influence that in any way.
 
Share this answer
 
Comments
santosh code 31-Oct-18 2:48am    
We are using order by via dynamic linq where we specify the sort column name and order by clause. We dont write any specifi sql queries as we are using entity framework using iqueryable to generate the queries for us.
thank you for the answer but the given proposed solution will not be useful for us.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900