开发者

Sorting OrderedEnumerableRowCollection .. strings like 00-000, 01-000 are not sorted as expected

i've got some records from a query like this

SortingCode (column) Row: 00-005 Row: 00-000

the folowing code, doesn't sort this 开发者_如何学C...

var items = 
    from c in table
    orderby c.SortingCode
    select c;


You will have to explain what result you are expecting, because the following code

var items = new List<string>() { "00-005", "01-004", "00-003" };

foreach (var item in items.OrderBy(i => i))
{
    Console.WriteLine(item);
}

Do output

00-003
00-005
01-004

Which seem well sorted for me. What result are you expecting?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜