SqlBoolean.CompareTo Method

Definition

Compares this instance to a specified object and returns an indication of their relative values.

Overloads

CompareTo(SqlBoolean)

Compares this SqlBoolean object to the supplied SqlBoolean object and returns an indication of their relative values.

CompareTo(Object)

Compares this SqlBoolean structure to a specified object and returns an indication of their relative values.

Remarks

This method is implemented to support the IComparable interface.

CompareTo(SqlBoolean)

Source:
SQLBoolean.cs
Source:
SQLBoolean.cs
Source:
SQLBoolean.cs

Compares this SqlBoolean object to the supplied SqlBoolean object and returns an indication of their relative values.

C#
public int CompareTo(System.Data.SqlTypes.SqlBoolean value);

Parameters

value
SqlBoolean

A SqlBooleanSqlBoolean object to compare, or a null reference (Nothing in Visual Basic).

Returns

A signed number that indicates the relative values of the instance and value.

Value Description
A negative integer This instance is less than value.
Zero This instance is equal to value.
A positive integer This instance is greater than value, or value is a null reference (Nothing in Visual Basic).

Remarks

Any instance of SqlBoolean, regardless of its value, is considered greater than a null reference (Nothing in Visual Basic).

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CompareTo(Object)

Source:
SQLBoolean.cs
Source:
SQLBoolean.cs
Source:
SQLBoolean.cs

Compares this SqlBoolean structure to a specified object and returns an indication of their relative values.

C#
public int CompareTo(object? value);
C#
public int CompareTo(object value);

Parameters

value
Object

An object to compare, or a null reference (Nothing in Visual Basic).

Returns

A signed number that indicates the relative values of the instance and value.

Value Description
A negative integer This instance is less than value.
Zero This instance is equal to value.
A positive integer This instance is greater than value, or value is a null reference (Nothing in Visual Basic).

Implements

Remarks

Any instance of SqlBoolean, regardless of its value, is considered greater than a null reference (Nothing in Visual Basic).

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1