다음을 통해 공유


PropertyStatement Class

Describes a logic statement in the form "IF <Condition> THEN <Result>," where the result is a scalar value. This class cannot be inherited.

네임스페이스: Microsoft.SqlServer.NotificationServices.Rules
어셈블리: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)

구문

‘선언
Public Class PropertyStatement
    Inherits LogicStatement
public class PropertyStatement : LogicStatement
public ref class PropertyStatement : public LogicStatement
public class PropertyStatement extends LogicStatement
public class PropertyStatement extends LogicStatement

주의

PropertyStatement objects are used by PropertyRule objects. If the condition for the property statement is met, the result defined by the Result property is returned.

You must specify values for the Result and Condition properties.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.NotificationServices.Rules.RuleObject
     Microsoft.SqlServer.NotificationServices.Rules.LogicStatement
      Microsoft.SqlServer.NotificationServices.Rules.PropertyStatement

The following example shows how to specify three properties: Few, Some, and Alot. Subscribers can use these properties when defining subscriptions.

// Define a new property that defines "Few," "Some," and "Alot"
// of inventory. 
PropertyRule quantityCategory = new PropertyRule(
    new ViewInputType(eventView),
    new PropertyStatement(new SimpleLeafCondition(
        new FieldValue("Quantity"),
        SimpleOperator.LessThan, 100), "Few"),
    new PropertyStatement(new BetweenLeafCondition(
        new FieldValue("Quantity"), 100, 200), "Some"),
    new PropertyStatement(new SimpleLeafCondition(
            new FieldValue("Quantity"),
            SimpleOperator.GreaterThan, 200),
        "Alot"));

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


// Use the new property to return only products with "few" remaining
// in inventory. Note that the category definition can be reused.
s.Condition = new SimpleLeafCondition(
    new RuleValue(quantityCategory),
    SimpleOperator.Equals,
    "Few");

// Add subscription.
s.Add();

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

PropertyStatement Members
Microsoft.SqlServer.NotificationServices.Rules Namespace