親である NotificationClass および名前を使用して、NotificationField クラスの新しいインスタンスを初期化します。
名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)
構文
'宣言
Public Sub New ( _
notificationClass As NotificationClass, _
name As String _
)
public NotificationField (
NotificationClass notificationClass,
string name
)
public:
NotificationField (
NotificationClass^ notificationClass,
String^ name
)
public NotificationField (
NotificationClass notificationClass,
String name
)
public function NotificationField (
notificationClass : NotificationClass,
name : String
)
パラメータ
- notificationClass
計算フィールドの親である NotificationClass オブジェクトです。
name
計算フィールドの名前を示す長さ 1 ~ 128 文字の String です。名前は変更できません。通知フィールドの名前を変更するには、フィールドを削除してから、新しい名前を持つフィールドを追加する必要があります。
解説
フィールド名には、英字、数字、および特殊文字の _、#、@、および $ を含めることができます。また、Microsoft SQL Server の識別子規則に準拠する必要があります。SQL Server 識別子の詳細については、「識別子」を参照してください。
フィールド名を変更した後、アプリケーションを更新すると、対応する通知クラスがいったん削除され、再作成されます。同時に、この通知クラスが使用していた SQL Server のテーブルも削除され、再作成されます。元の通知クラスのテーブル内に存在するデータは、すべて完全に削除されます。
このコンストラクタでは、DigestGrouping プロパティは false に設定されます。
フィールドのデータ型を指定するには、Type プロパティを設定する必要があります。
使用例
次の例は、通知フィールドを定義して通知クラスの通知フィールドのコレクションに追加する方法を示しています。
// 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)
プラットフォーム
開発プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
対象プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
参照
関連項目
NotificationField Class
NotificationField Members
Microsoft.SqlServer.Management.Nmo Namespace