共用方式為


AdoDotNetObjectMemberComparer.Compare 方法 (String, array<Object , Int32, Object)

將物件識別項組件與另一個指定的物件識別項 (OID) 組件比較。

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

語法

'宣告
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

參數

  • identifier
    型別:array<System.Object[]
    這個型別的物件識別項 typeName 參數指定的,用來做為識別項的陣列不同。
  • identifierPart
    型別:System.Int32
    在表示識別項的哪個部分識別陣列中以零起始的索引來比較。

傳回值

型別:System.Int32
整數值小於零,如果識別項部分的指定值小於,零,如果識別項部分等於指定值或大於零,如果識別項部分大於指定值大於。

實作

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

備註

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

傳入完整的來源識別項,某些複雜情況中進行處理。整個,例如 Microsoft SQL Server 的最新版本可讓伺服器位於識別項的比較,當伺服器上的特定資料庫可能是不區分大小寫時的大小寫,否則反之亦然區分大小寫。這表示,當比較結構描述時或資料表 (顯示為第二個和中的完整資料表識別項的第三個部分中,第一個部分的名稱資料庫),這個方法的實作必須使用第一個識別項組件判斷哪一個資料庫資料表是而,使用何種比較。

這個實作會從 ADO.NET 資料來源資訊資料表擷取 IdentifierCase 資料來源資訊屬性並使用值來判斷是否區分大小寫的比較是否獲得認可。

.NET Framework 安全性

請參閱

參考

AdoDotNetObjectMemberComparer 類別

Compare 多載

Microsoft.VisualStudio.Data.Framework.AdoDotNet 命名空間