AndCondition Constructor (Condition[])
Initializes a new instance of the AndCondition class with the component Condition objects.
Namespace: Microsoft.SqlServer.NotificationServices.Rules
Assembly: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
Syntax
'Declaration
Public Sub New ( _
ParamArray children As Condition() _
)
public AndCondition (
params Condition[] children
)
public:
AndCondition (
... array<Condition^>^ children
)
public AndCondition (
Condition[] children
)
public function AndCondition (
... children : Condition[]
)
Parameters
- children
One or more Condition objects that will be individually evaluated and then the logically evaluated together using AND Boolean logic.
Remarks
You must specify at least one child condition for an AndCondition object.
Example
// Create the NSInstance object.
NSInstance testInstance =
new NSInstance("InventoryTrackerInstance");
// Create the NSApplication object.
NSApplication testApplication =
new NSApplication(testInstance, "InventoryTracker");
// Create Subscription object.
Subscription s = new Subscription(testApplication,
"InventoryTrackerSubscriptions");
// Define subscription properties
s.SubscriberId = "TestUser1";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s["DeviceName"] = "Work e-mail";
s["SubscriberLocale"] = "en-US";
// Define OrCondition
s.Condition = new AndCondition(
new SimpleLeafCondition(new FieldValue("ProductName"),
SimpleOperator.Equals,
"Road-250 Black, 48"),
new SimpleLeafCondition(new FieldValue("LocationName"),
SimpleOperator.Equals,
"Final Assembly"),
new SimpleLeafCondition(new FieldValue("Quantity"),
SimpleOperator.LessThanOrEqualTo,
35)
);
// Add subscription
s.Add();
' Create the NSInstance object.
Dim testInstance As New NSInstance("InventoryTrackerInstance")
' Create the NSApplication object.
Dim testApplication As _
New NSApplication(testInstance, "InventoryTracker")
' Create Subscription object.
Dim s As New Subscription(testApplication, _
"InventoryTrackerSubscriptions")
' Define subscription properties
s.SubscriberId = "TestUser1"
s.Enabled = True
s.RuleName = "InventoryTrackerRule"
s("DeviceName") = "Work e-mail"
s("SubscriberLocale") = "en-US"
' Define OrCondition
s.Condition = New AndCondition( _
New SimpleLeafCondition( _
New FieldValue("ProductName"), _
SimpleOperator.Equals, _
"Road-250 Black, 48"), _
New SimpleLeafCondition( _
New FieldValue("LocationName"), _
SimpleOperator.Equals, _
"Final Assembly"), _
New SimpleLeafCondition( _
New FieldValue("Quantity"), _
SimpleOperator.LessThanOrEqualTo, _
35))
' Add subscription
s.Add()
Platforms
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.
Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.
See Also
Reference
AndCondition Class
AndCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace