I have more columns in datatable (about 100 columns). See examble below:
Column 1 | Column 2 | Column 3 | ..... | Column n 1;Nick | 1 | USA | ..... | Value 1 2;David | 2 | Reston | ..... | Value 2 3;Marry | 3 | Spain | ..... | Value 3 4;Join | 4 | Italy 3 | ..... Value 4
Dictionary<string, string > dict = new Dictionary<string, string>();
dict.Add("Column_1", "asc");
dict.Add("Column_2", "asc");
dict.Add("Column_1", "desc");
...................
dict.Add("Column_n", "asc");
var myRows = from row in datatable.AsEnumerable()
let myID = int.Parse(row.Field<string>("Column 2"))
let name = row.Field<string>("Column 1").Split(';')[1]
....
orderby myID ascending, name descending, ......, column n asc
select row;
My problem is how to loop all items in Dictionary to add more let statements and orderby all columns in Dictionary.
Please help me to fix it. My english is not good, sorry