Answer the question
In order to leave comments, you need to log in
DataTable sort column of type String as number?
Hello everyone
, please help me sort the rows in the DataTable correctly by the column that stores the values in the hexadecimal system, that is, the strings of the "0x0..F" format. Now I do this:
var dataRows = (from row in ds.Tables[0].Select()
orderby Int32.Parse(row["Type"].ToString().TrimStart(new[] { '0', 'x' }),
NumberStyles.HexNumber |
NumberStyles.AllowHexSpecifier) ascending
select r).AsEnumerable();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question