linq sort by dynamic code example Example: linq dynamic order by descending myDataSource.OrderBy(columnName + " descending");