AndCondition Constructor (Condition[])
Initializes a new instance of the AndCondition class with the component Condition objects.
命名空間: Microsoft.SqlServer.NotificationServices.Rules
組件: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
語法
'宣告
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[]
)
參數
- children
One or more Condition objects that will be individually evaluated and then the logically evaluated together using AND Boolean logic.
備註
You must specify at least one child condition for an AndCondition object.
範例
// 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()
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
AndCondition Class
AndCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace