Freigeben über


LinkLeafCondition.Filter Property

A FilterRule object whose logic determines whether rows from the table or view related through the LinkChain property match the Operator criteria.

Namespace: Microsoft.SqlServer.NotificationServices.Rules
Assembly : Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)

Syntax

'Declaration
Public Property Filter As FilterRule
public FilterRule Filter { get; set; }
public:
property FilterRule^ Filter {
    FilterRule^ get ();
    void set (FilterRule^ value);
}
/** @property */
public FilterRule get_Filter ()

/** @property */
public void set_Filter (FilterRule value)
public function get Filter () : FilterRule

public function set Filter (value : FilterRule)

Eigenschaftswert

The FilterRule object.

Beispiel

The following example shows how to define a filter and then use that filter in a subscription:

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

Threadsicherheit

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plattformen

Entwicklungsplattformen

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Zielplattforme

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Siehe auch

Verweis

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