linq - List.OrderBy returns a collection of empty strings -
i have collection string date values of empty strings ("").
when use orderby clause, following statement
thelist = thelist.orderby(function(x) x.age).tolist()
returns empty string collection.
however, if use orderbydescending operator, result correctly ordered descending data values.
sample date values "2014-10-31 00:00:00.000", "2014-09-30 00:00:00.000", "2014-11-30 00:00:00.000", "", "2014-08-31 00:00:00.000".
what problem please?
thank you,
piyush varma
my first instinct if x.billedthru ever shorter 10 characters, see behavior. return rows if try this:
dim returncollection list(of fundedaccountsdetail) = new list(of fundedaccountsdetail) select case sortby case "billedthru" if ascending = "asc" returncollection = reportcollection.orderby(function(x) x.billedthru).tolist() elseif ascending = "desc" returncollection = reportcollection.orderbydescending(function(x) x.billedthru).tolist() end if case else returncollection = reportcollection end select
if does, problem substring. if not, admit perplexing. i'd try removing order first branch of if , see if returns rows. work way until branch of if works , rebuild step step until start having problem.
Comments
Post a Comment