次の方法で共有


Event.GetFieldOrdinal Method

イベント レコード内のフィールドの序数 (0 から始まります) を返します。

名前空間: Microsoft.SqlServer.NotificationServices
アセンブリ: Microsoft.SqlServer.NotificationServices (microsoft.sqlserver.notificationservices.dll 内)

構文

'宣言
Public Function GetFieldOrdinal ( _
    fieldName As String _
) As Integer
public int GetFieldOrdinal (
    string fieldName
)
public:
virtual int GetFieldOrdinal (
    String^ fieldName
) sealed
public final int GetFieldOrdinal (
    String fieldName
)
public final function GetFieldOrdinal (
    fieldName : String
) : int

パラメータ

  • fieldName
    イベント フィールドの名前です。この名前に対応する序数が返されます。

戻り値

フィールドの序数 (0 から始まります) を表す整数値です。

使用例

GetFieldOrdinal メソッドを使用し、フィールド名を指定することによってイベント フィールドの序数を取得する例を次に示します。

これらの例では、Microsoft.SqlServer.NotificationServices 名前空間を使用しています。

Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim eventClassName As String = "MyEventClassName"
Dim fieldName As String = "MyEventFieldName"

'Create an NSInstance object.
Dim myInstance As New NSInstance(instanceName)

'Create an NSApplication object.
Dim myApplication As New NSApplication(myInstance, applicationName)

'Create an Event object.
Dim myEvent As New Microsoft.SqlServer.NotificationServices.Event( _
    myApplication, eventClassName)

'Use the GetFieldOrdinal method to get a field ordinal.
Dim fieldOrdinal As Integer = myEvent.GetFieldOrdinal(fieldName)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string eventClassName = "MyEventClassName";
string fieldName = "MyEventFieldName";

//Create an NSInstance object.
NSInstance myInstance = new NSInstance(instanceName);

//Create an NSApplication object.
NSApplication myApplication = 
    new NSApplication(myInstance, applicationName);

//Create an Event object.
Event myEvent = new Event(myApplication, eventClassName);

//Use the GetFieldOrdinal method to get a field ordinal.
int fieldOrdinal = myEvent.GetFieldOrdinal(fieldName);

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

Event Class
Event Members
Microsoft.SqlServer.NotificationServices Namespace