IDataReader.GetOrdinal 方法

Return the index of the named field.

命名空间:  Microsoft.ReportingServices.DataProcessing
程序集:   Microsoft.ReportingServices.Interfaces(在 Microsoft.ReportingServices.Interfaces.dll 中)
  Microsoft.ReportingServices.SharePoint.UI.WebParts(在 Microsoft.ReportingServices.SharePoint.UI.WebParts.dll 中)

语法

声明
Function GetOrdinal ( _
    fieldName As String _
) As Integer
用法
Dim instance As IDataReader
Dim fieldName As String
Dim returnValue As Integer

returnValue = instance.GetOrdinal(fieldName)
int GetOrdinal(
    string fieldName
)
int GetOrdinal(
    String^ fieldName
)
abstract GetOrdinal : 
        fieldName:string -> int 
function GetOrdinal(
    fieldName : String
) : int

参数

  • fieldName
    类型:System.String
    The name of the field to find.

返回值

类型:System.Int32
The index of the named field.

注释

GetOrdinal performs a case-sensitive lookup first. If it fails, a second case-insensitive search is made.

GetOrdinal is kana-width insensitive.

Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call GetOrdinal within a loop. Save time by calling GetOrdinal once and assigning the results to an integer variable for use within the loop.