次の方法で共有


Event.GetFieldName Method

イベント レコード内のフィールドの名前を取得します。

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

構文

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

パラメータ

  • fieldOrdinal
    イベント フィールドの序数 (0 から始まります)。この序数に対応する名前が返されます。

戻り値

フィールドの名前を表す文字列です。

使用例

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

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

Dim instanceName As String = "MyInstanceName"
Dim applicationName As String = "MyApplicationName"
Dim eventClassName As String = "MyEventClassName"
Dim fieldOrdinal As Integer = 0

'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 GetFieldName method to get a field name.
Dim fieldName As String = myEvent.GetFieldName(fieldOrdinal)
string instanceName = "MyInstanceName";
string applicationName = "MyApplicationName";
string eventClassName = "MyEventClassName";
int fieldOrdinal = 0;

//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 GetFieldName method to get a field name.
string fieldName = myEvent.GetFieldName(fieldOrdinal);

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

Event Class
Event Members
Microsoft.SqlServer.NotificationServices Namespace