共用方式為


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

當由類別實作時,這個物件識別項 (OID) 組件與另一個指定的物件識別項 (OID) 組件比較。

命名空間:  Microsoft.VisualStudio.Data.Services.SupportEntities
組件:  Microsoft.VisualStudio.Data.Services (在 Microsoft.VisualStudio.Data.Services.dll 中)

語法

'宣告
Function Compare ( _
    typeName As String, _
    identifier As Object(), _
    identifierPart As Integer, _
    value As Object _
) As Integer
int Compare(
    string typeName,
    Object[] identifier,
    int identifierPart,
    Object value
)
int Compare(
    String^ typeName, 
    array<Object^>^ identifier, 
    int identifierPart, 
    Object^ value
)
abstract Compare : 
        typeName:string * 
        identifier:Object[] * 
        identifierPart:int * 
        value:Object -> int
function Compare(
    typeName : String, 
    identifier : Object[], 
    identifierPart : int, 
    value : Object
) : int

參數

  • typeName
    類型:String

    識別項的型別名稱。

  • identifier
    類型:array<Object[]

    陣列識別資料物件的識別組件。

  • identifierPart
    類型:Int32

    以零起始的索引表示識別項的哪個部分識別項陣列中的比較。

  • value
    類型:Object

    比較識別組件的值。

傳回值

類型:Int32
小於零的值,以識別組件大於指定之處理小於;零,如果識別項部分等於指定值,大於零的值,如果識別項部分大於指定值大於。

備註

這個方法應使用比較規則與資料來源相同確保正確的物件唯一在用戶端執行。

您可以藉由處理某些複雜條件在完整的來源識別項。 整個,例如 Microsoft SQL Server 的最新版本可讓 SQL Server 執行個體是在識別項比較,反之,在 SQL Server 執行個體的特定資料庫可以是不區分大小寫,反之亦然區分大小寫。 這表示,當比較結構描述時 (或資料表會出現在第二和第三個部分中,分別,在完整資料表識別項,是第一個部分的名稱資料庫),這個方法的實作必須使用第一個識別項組件判斷哪一個資料庫資料表是而,使用何種比較。

.NET Framework 安全性

請參閱

參考

IVsDataObjectMemberComparer 介面

Compare 多載

Microsoft.VisualStudio.Data.Services.SupportEntities 命名空間