I have 2 data tables, one in which i have my data(D1) with a unique data Id and in another data table(D2) i have the Ids of all the records of my data table(D1) in a particular order.How can i sort my data table(D1) based on the order of Ids in D2.I am using c# asp.net
Share
You could copy the rows in the ordering table into a
Dicationarywith an index. Assuming your key field is namedKeythe code might look like this:As I read Peaceman71’s comment, I think it is worth mentioning that this is a disconnected approach. Any proper database software will do this for you as well.