I have a sql stored procedure that uses isnull in the order by clause to order items by the latest reply date, or if that is null, by the posting date:
Example:
ORDER BY isnull(rtb.LatestReplyDate,CB_TOPIC_DATE_POSTED) DESC
I am trying to get that to work in the orderby clause of a linqdatasource, to no avail yet:
Example:
I know isnull isn’t valid there, but I have yet to figure out what would work, if anything. I tried the ?? operator as well. Any ideas?
Check this linq..err…link
–Addendum
In your case: