0
Your question is not clear enough, so I’m going to kick over what might be going on based on your mistake.
That is to say, icomparable interface
This interface is implemented by types whose values can be sorted or sorted.It requires the implementation types to define a single method, Compareto(Object), indicating whether the position of the current instance in the classification order is before, after, or the same as a second object of the same type.
The implementation of the Icomparable instance is automatically called by methods, such as Array.Sort and Arraylist.Sort.
The Compareto(Object) method implementation should return an Int32 that has one of the three values, as shown in the following table
Summarizing your object must be null and does not implement the icomparable interface and cannot be compared with the object of the current instance.
If you put in the code maybe someone who understands can help you. The way you are is hard to guess your problem.
– durtto
Provide more details so we can analyze the problem
– Diego Farias