次の方法で共有


SubscriptionEventRule.Parent Property

イベント ルールの親の SubscriptionClass オブジェクトを取得または設定します。

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

構文

'宣言
Public Property Parent As SubscriptionClass
public SubscriptionClass Parent { get; set; }
public:
property SubscriptionClass^ Parent {
    SubscriptionClass^ get ();
    void set (SubscriptionClass^ value);
}
/** @property */
public SubscriptionClass get_Parent ()

/** @property */
public void set_Parent (SubscriptionClass value)
public function get Parent () : SubscriptionClass

public function set Parent (value : SubscriptionClass)

プロパティ値

親である SubscriptionClass オブジェクトです。

解説

更新されたテキスト :2005 年 12 月 5 日

更新されたサンプル コード :2005 年 12 月 5 日

SubscriptionEventRule には、それぞれ親の SubscriptionClass があります。通常は、SubscriptionEventRule(SubscriptionClass,String) コンストラクタを使用して SubscriptionEventRule を作成する際に、親オブジェクトを指定します。

コンストラクタで親を設定する場合は、このプロパティを使用して親を設定しないでください。親を 2 回設定すると例外がスローされます。

使用例

次の例は、既定のコンストラクタを使用する場合に Parent プロパティを設定する方法を示しています。

// Create an event rule and set properties.
SubscriptionEventRule flightEventRule = new SubscriptionEventRule();
flightEventRule.Name = "FlightSubscriptionsEventRule";
flightEventRule.Parent = flightSubscriptions;
flightEventRule.Action = "INSERT INTO FlightNotifications " + 
    "(SubscriberId, DeviceName, SubscriberLocale, " + 
    "LeavingFrom, GoingTo, Price) " + 
    "SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale, " + 
    "E.LeavingFrom, E.GoingTo, E.Price " + 
    "FROM FlightEvents E, FlightSubscriptions S " + 
    "WHERE     E.LeavingFrom     = S.LeavingFrom " + 
    "AND    E.GoingTo    = S.GoingTo " + 
    "AND    E.Price    < S.Price";
flightEventRule.ActionTimeout = new TimeSpan(0, 30, 0);
flightEventRule.EventClassName = "FlightEvents";
flightSubscriptions.SubscriptionEventRules.Add(flightEventRule);
' Create an event rule and set properties.
Dim flightEventRule As SubscriptionEventRule = _
    New SubscriptionEventRule()
flightEventRule.Name = "FlightSubscriptionsEventRule"
flightEventRule.Parent = flightSubscriptions
flightEventRule.Action = "INSERT INTO FlightNotifications " + _
    "(SubscriberId, DeviceName, SubscriberLocale, " + _
    "LeavingFrom, GoingTo, Price) " + _
    "SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale, " + _
    "E.LeavingFrom, E.GoingTo, E.Price " + _
    "FROM FlightEvents E, FlightSubscriptions S " + _
    "WHERE     E.LeavingFrom     = S.LeavingFrom " + _
    "AND    E.GoingTo    = S.GoingTo " + _
    "AND    E.Price    < S.Price"
flightEventRule.ActionTimeout = New TimeSpan(0, 30, 0)
flightEventRule.EventClassName = "FlightEvents"
flightSubscriptions.SubscriptionEventRules.Add(flightEventRule)

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

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

その他の技術情報

イベント ルールの定義
SubscriptionClass 要素 (ADF)