次の方法で共有


FilterRule.FilterStatements Property

このインスタンスのロジックを説明する FilterStatement オブジェクトのコレクションを取得します。

名前空間: Microsoft.SqlServer.NotificationServices.Rules
アセンブリ: Microsoft.SqlServer.NotificationServices.Rules (microsoft.sqlserver.notificationservices.rules.dll 内)

構文

'宣言
Public ReadOnly Property FilterStatements As Collection(Of FilterStatement)
public Collection<FilterStatement> FilterStatements { get; }
public:
property Collection<FilterStatement^>^ FilterStatements {
    Collection<FilterStatement^>^ get ();
}
/** @property */
public Collection<FilterStatement> get_FilterStatements ()
public function get FilterStatements () : Collection<FilterStatement>

プロパティ値

FilterStatement オブジェクトの Collection です。

解説

複数のステートメントを定義する場合、Exclude アクションが設定されたステートメントは、Include アクションが設定されたステートメントより優先されます。Include ステートメントが定義されていない場合、入力は既定で追加されます。それ以外の場合、入力は既定で除外されます。

使用例

次の例に、1 つのフィルタ ステートメントを使用するフィルタを示します。このフィルタは、Name の値が Subassembly である Production.Location テーブルの行を含んでいます。このフィルタは LinkLeafCondition で使用され、フィルタ条件を満たすイベントのみを含む、イベントと場所データを結合します。

// Subscribe to products in Subassembly location. This
// requires select permissions on all tables in the sample.

//Specify server and database.
Server server = new Server("MyServer");
Database db = server.Databases[nsApplication.DatabaseName];

// Specify tables and views used by the condition.
Table locationTable = db.Tables["Location", "Production"];
Table inventoryTable = db.Tables["ProductInventory", "Production"];
View eventView = db.Views["InventoryTrackerEvents",
    "NS_InventoryTrackerApplication"];

// Filter defining "Subassembly" locations.
FilterRule toolCrib = new FilterRule(
    new TableInputType(db.Tables["Location", "Production"]),
    new SimpleLeafCondition(new FieldValue("Name"),
        SimpleOperator.Equals, "Subassembly"));

// Create subscription and define basic properties.
s = new Subscription(nsApplication, subscriptionClassName);
s.SubscriberId = "Stephanie";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s.SetFieldValue("DeviceName", "myDevice");
s.SetFieldValue("SubscriberLocale", "en-us");

// Define a condition using the filter.
s.Condition = new LinkLeafCondition(
    LinkLeafOperator.Any,
    toolCrib,
    new JoinClause(eventView.Columns["ProductId"],
        inventoryTable.Columns["ProductId"]),
    new JoinClause(inventoryTable.Columns["LocationId"],
        locationTable.Columns["LocationId"]));

// Add subscription.
s.Add();

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

FilterRule Class
FilterRule Members
Microsoft.SqlServer.NotificationServices.Rules Namespace