Compartir a través de


BooleanLeafCondition Constructor (Argument)

Initializes a new instance of the BooleanLeafCondition class with an Argument object to evaluate.

Espacio de nombres: Microsoft.SqlServer.NotificationServices.Rules
Ensamblado: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)

Sintaxis

'Declaración
Public Sub New ( _
    argument As Argument _
)
public BooleanLeafCondition (
    Argument argument
)
public:
BooleanLeafCondition (
    Argument^ argument
)
public BooleanLeafCondition (
    Argument argument
)
public function BooleanLeafCondition (
    argument : Argument
)

Parámetros

  • argument
    The Boolean-valued Argument to evaluate. This parameter sets the Argument property.

Notas

argument must support being cast to a Microsoft SQL Server bit data type.

Ejemplo

Instead of checking a field or using a function, the condition in this example simply sets the Boolean value to true, resulting in notifications for all events. This could be used in an enterprise monitoring subscription or a subscription used to verify that the Notification Services application is generating notifications as expected:

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

// Define a condition that is true for all events.
s.Condition = new BooleanLeafCondition(true);

// Add subscription.
s.Add();

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

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