次の方法で共有


NotificationClass.NotificationFields Property

通知クラスの標準通知フィールド (非計算フィールド) のコレクションを取得します。

名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)

構文

'宣言
Public ReadOnly Property NotificationFields As NotificationFieldCollection
public NotificationFieldCollection NotificationFields { get; }
public:
property NotificationFieldCollection^ NotificationFields {
    NotificationFieldCollection^ get ();
}
/** @property */
public NotificationFieldCollection get_NotificationFields ()
public function get NotificationFields () : NotificationFieldCollection

プロパティ値

通知クラスの非計算フィールドのコレクションを表す NotificationComputedFieldCollection オブジェクトです。

解説

通知フィールドは、通知クラスの通知データ ストレージを定義します。通知を生成するサブスクリプション ルールは、これらのフィールドに通知の値を挿入します。

各通知クラスについて、NotificationFieldCollection に少なくとも 1 つの NotificationField が必要です。

使用例

次の例は、NotificationFieldCollection を使用して通知クラスに通知フィールドを追加する方法を示しています。

// Define a LeavingFrom notification field and use it for grouping 
// digest messages. Add it to the end of the field collection
NotificationField notificationOrgin = 
    new NotificationField(flightNotifications, "LeavingFrom");
notificationOrgin.Type = "nvarchar(6)";
notificationOrgin.DigestGrouping = true;
flightNotifications.NotificationFields.Add(notificationOrgin);
' Define a LeavingFrom field and use it for grouping
' digest messages. Add it to the end of the collection.
Dim notificationOrgin As NotificationField = _
    New NotificationField(flightNotifications, "LeavingFrom")
notificationOrgin.Type = "nvarchar(6)"
notificationOrgin.DigestGrouping = True
flightNotifications.NotificationFields.Add(notificationOrgin)

特定の位置にフィールドを追加できます。

// Define a Price field and add it at position 1 in the collection
NotificationField notificationPrice = 
    new NotificationField(flightNotifications, "Price");
notificationPrice.Type = "float";
flightNotifications.NotificationFields.Add(notificationPrice, 1);
' Define a Price field and add it at position 1 
' in the collection.
Dim notificationPrice As NotificationField = _
    New NotificationField(flightNotifications, "Price")
notificationPrice.Type = "float"
flightNotifications.NotificationFields.Add( _
    notificationPrice, 1)

特定の通知フィールドの前にフィールドを追加することもできます。

// Define a GoingTo field and add it before the Price field
NotificationField notificationDestination = 
    new NotificationField(flightNotifications, "GoingTo");
notificationDestination.Type = "nvarchar(6)";
flightNotifications.NotificationFields.Add(
    notificationDestination, "Price");
' Define a GoingTo field and add it before the Price field.
Dim notificationDestination As NotificationField = _
    New NotificationField(flightNotifications, "GoingTo")
notificationDestination.Type = "nvarchar(6)"
flightNotifications.NotificationFields.Add( _
    notificationDestination, "Price")

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

NotificationClass Class
NotificationClass Members
Microsoft.SqlServer.Management.Nmo Namespace

その他の技術情報

通知クラスの定義
通知スキーマの定義
Schema の Fields 要素 (ADF)