次の方法で共有


NotificationFieldCollection.Add Method (NotificationField)

NotificationFieldNotificationFieldCollection の末尾に追加します。

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

構文

'宣言
Public Sub Add ( _
    notificationField As NotificationField _
)
public void Add (
    NotificationField notificationField
)
public:
void Add (
    NotificationField^ notificationField
)
public void Add (
    NotificationField notificationField
)
public function Add (
    notificationField : NotificationField
)

パラメータ

解説

配置したアプリケーションにフィールドを追加した後、インスタンスを更新すると、対応する通知クラスがいったん削除され、再作成されます。同時に、この通知クラスが使用していたテーブルとビューも削除され、再作成されます。既存の SQL Server テーブル内のデータは、すべて完全に削除されます。

インスタンスを更新するには、Update メソッドを使用します。

使用例

次の例は、通知クラスの通知フィールドのコレクションの末尾に通知フィールドを追加する方法を示しています。

// 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)

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

NotificationFieldCollection Class
NotificationFieldCollection Members
Microsoft.SqlServer.Management.Nmo Namespace
Instance.Update Method

その他の技術情報

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