NotificationField を NotificationFieldCollection の末尾に追加します。
名前空間: 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
)
パラメータ
- 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