I have a problem with LINQ (in C#). I need to order a list of records by a field, which should be int, but sometimes not :
from MyObject obj in new MyObject()
where obj.Visibile=="1"
orderby Int32.Parse(obj.Order) ascending
select obj;
and, as I said, if obj.Order is it not int, I get an error : System.FormatException: Input string was not in a correct format.
I’d like to put the non-int items at the end of the list, without get any error. Is it possible?
Try by maming use of TryParse
OR