I have a two-column table containing the columns CustomerName and Age. I have all the data in a DataTable. I want to sort it in descending order by Age, and then each age group is sorted by name. Thus, all people aged 30 years will be sorted alphabetically and will be between the lists of people aged 29 to 31 years.
I have:
string selectStatement = "Age";
string sortStatement = "Age DESC"
var rows = table.Select(selectStatement, sortStatement);
It should be sorted by age. I did not understand how to sort each age group alphabetically, but the above throws an exception:
The age filter expression is not evaluated in a boolean expression.
source
share