I have the following code but am having issues with how to maintain the order:
var cars = (from DataRow dRow in dt.AsEnumerable()
select new
{
Car = dRow["Car"],
CarId = dRow["CarId"],
CarOrder = dRow["CarOrder"]
}).Distinct();
The distinct works well but I need to preserver the CarOrder which goes from 1 to X (ascedning).
The DataTable dt have them all in order correctly but when it hits this distinct code the order does not get preserved.
I am trying to figure out how to use the OrderBy clause.