Delen via


AdoDotNetObjectMemberComparer.Compare Method (String, array<Object , Int32, Object)

Compares one object identifier part with another specified object identifier part.

Namespace:  Microsoft.VisualStudio.Data.Framework.AdoDotNet
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
Public Overrides Function Compare ( _
    typeName As String, _
    identifier As Object(), _
    identifierPart As Integer, _
    value As Object _
) As Integer
public override int Compare(
    string typeName,
    Object[] identifier,
    int identifierPart,
    Object value
)
public:
virtual int Compare(
    String^ typeName, 
    array<Object^>^ identifier, 
    int identifierPart, 
    Object^ value
) override
abstract Compare : 
        typeName:string * 
        identifier:Object[] * 
        identifierPart:int * 
        value:Object -> int  
override Compare : 
        typeName:string * 
        identifier:Object[] * 
        identifierPart:int * 
        value:Object -> int
public override function Compare(
    typeName : String, 
    identifier : Object[], 
    identifierPart : int, 
    value : Object
) : int

Parameters

  • identifier
    Type: array<System.Object[]

    The identifier of an object of the type specified by the typeName parameter, represented as an array of identifier parts.

  • identifierPart
    Type: System.Int32

    The zero-based index in the identifier array indicating which part of the identifier to compare.

  • value
    Type: System.Object

    A value to compare the identifier part against.

Return Value

Type: System.Int32
An integer value less than zero if the identifier part is less than the specified value, zero if the identifier part is equal to the specified value, or greater than zero if the identifier part is greater than the specified value.

Implements

IVsDataObjectMemberComparer.Compare(String, array<Object[], Int32, Object)

Remarks

This method should use the same comparison rules as the data source to ensure the correct uniqueness of objects on the client side.

By passing in the complete source identifier, certain complex situations can be handled. For example, recent versions of Microsoft SQL Server will allow the server as a whole to be case sensitive on identifier comparison while a particular database on the server may be case insensitive, or vice versa. This means that when comparing the schema or name of a table (which appears as the second and third parts in a full table identifier, the first part being the database), the implementation of this method must use the first identifier part to determine which database the table is in, and thus, what kind of comparison to use.

This implementation retrieves the IdentifierCase data source information property from the ADO.NET data source information table and uses the value to determine whether a case-sensitive comparison is warranted.

.NET Framework Security

See Also

Reference

AdoDotNetObjectMemberComparer Class

Compare Overload

Microsoft.VisualStudio.Data.Framework.AdoDotNet Namespace