CompareTo
This method compares the current OracleDate
instance to an object, and returns an integer that represents their relative values.
Declaration
// C#
public int CompareTo(object obj);
Parameters
-
obj
An object.
Return Value
The method returns:
-
Less than zero: if the current
OracleDate
instance value is less than that ofobj
. -
Zero: if the current
OracleDate
instance andobj
values are equal. -
Greater than zero: if the current
OracleDate
instance value is greater thanobj
.
Implements
IComparable
Exceptions
ArgumentException
- The obj
parameter is not an instance of OracleDate
.
Remarks
The following rules apply to the behavior of this method.
-
The comparison must be between
OracleDate
s. For example, comparing anOracleDate
instance with anOracleBinary
instance is not allowed. When anOracleDate
is compared with a different type, anArgumentException
is thrown. -
Any
OracleDate
that has a value compares greater than anOracleDate
that has a null value. -
Two
OracleDate
s that contain a null value are equal.