0

My LINQ sort is working fine (string & date) for asc... I'd like to get it working for desc. How can I reverse this? I'm going to be using viewstate to maintain the current sort direction.

 IEnumerable<DataRow> orderedRows;
 orderedRows = from row in dtValues.AsEnumerable() 
 let title = Convert.ToString(row.Field<string>("TITLE"), CultureInfo.InvariantCulture)
             orderby title
               select row;
 dValues = orderedRows.CopyToDataTable();

1 Answer 1

6

Just add descending

orderby title descending
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.