SqlDateTime.CompareTo SqlDateTime.CompareTo SqlDateTime.CompareTo SqlDateTime.CompareTo Method

定义

将此 SqlDateTime 结构与提供的参数进行比较,并返回其相对值的指示。Compares this SqlDateTime structure to the supplied parameter and returns an indication of their relative values.

重载

CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime)

将此 SqlDateTime 结构与提供的 SqlDateTime 结构进行比较,并返回其相对值的指示值。Compares this SqlDateTime structure to the supplied SqlDateTime structure and returns an indication of their relative values.

CompareTo(Object) CompareTo(Object) CompareTo(Object) CompareTo(Object)

将此 SqlDateTime 结构与提供的 Object 进行比较,并返回其相对值的指示值。Compares this SqlDateTime structure to the supplied Object and returns an indication of their relative values.

CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime) CompareTo(SqlDateTime)

将此 SqlDateTime 结构与提供的 SqlDateTime 结构进行比较,并返回其相对值的指示值。Compares this SqlDateTime structure to the supplied SqlDateTime structure and returns an indication of their relative values.

public:
 int CompareTo(System::Data::SqlTypes::SqlDateTime value);
public int CompareTo (System.Data.SqlTypes.SqlDateTime value);
member this.CompareTo : System.Data.SqlTypes.SqlDateTime -> int
Public Function CompareTo (value As SqlDateTime) As Integer

参数

value
SqlDateTime SqlDateTime SqlDateTime SqlDateTime

要比较的 SqlDateTime 结构。The SqlDateTime structure to be compared.

返回

一个有符号的数字,它指示该实例和对象的相对值。A signed number that indicates the relative values of the instance and the object.

返回值Return value 条件Condition
小于零Less than zero 此实例小于 SqlDateTimeThis instance is less than SqlDateTime.
Zero 此实例与 SqlDateTime 相同。This instance is the same as SqlDateTime.
大于零Greater than zero 此实例大于 SqlDateTimeThis instance is greater than SqlDateTime -or- SqlDateTime 为空引用(在 Visual Basic 中为 NothingSqlDateTime is a null reference (Nothing in Visual Basic)
另请参阅

CompareTo(Object) CompareTo(Object) CompareTo(Object) CompareTo(Object)

将此 SqlDateTime 结构与提供的 Object 进行比较,并返回其相对值的指示值。Compares this SqlDateTime structure to the supplied Object and returns an indication of their relative values.

public:
 virtual int CompareTo(System::Object ^ value);
public int CompareTo (object value);
abstract member CompareTo : obj -> int
override this.CompareTo : obj -> int
Public Function CompareTo (value As Object) As Integer

参数

value
Object Object Object Object

要比较的 ObjectThe Object to be compared.

返回

一个有符号的数字,它指示该实例和对象的相对值。A signed number that indicates the relative values of the instance and the object.

返回值Return value 条件Condition
小于零Less than zero 此实例小于该对象。This instance is less than the object.
Zero 此实例等于该对象。This instance is the same as the object.
大于零Greater than zero 此实例大于该对象This instance is greater than the object -or- 该对象是 null 引用(在 Visual Basic 中为 Nothing)。The object is a null reference (Nothing as Visual Basic).

实现

另请参阅

适用于