microsoft.public.sqlserver.notificationsvcs
[Top] [All Lists]

Re: dynamic conditions

Subject: Re: dynamic conditions
From:
Date: 24 Oct 2006 07:17:22 -0700
Newsgroups: microsoft.public.sqlserver.notificationsvcs
To elaborate:

sometimes I may have to do this:

subscription.Condition = new AndCondition(
  new SimpleLeafCondition(new FieldValue("name"),
  SimpleOperator.Like,
  new ConstantValue("DiK")),
  new SimpleLeafCondition(new FieldValue("Subject"),
  SimpleOperator.Like,
  new ConstantValue("%SQL%"))
);

some other users conditions may require this:

subscription.Condition = new AndCondition(
  new SimpleLeafCondition(new FieldValue("name"),
  SimpleOperator.Like,
  new ConstantValue("DK")),

  new SimpleLeafCondition(new FieldValue("Subject"),
  SimpleOperator.Like,
  new ConstantValue("%SQL%")),


  new SimpleLeafCondition(new FieldValue("email"),
    SimpleOperator.Like,
  new ConstantValue("%hotmail.com%"))
);


How can I dynamically generate these conditions?

Thanks for any light you can throw on this.
DK



[email protected] wrote:
> Hi Guys,
>
> I need to add dynamic conditions to my subscriptions.
>
> My situation is like this:
>
> Users are presented with a ad-hoc query builder and they can select
> upto 10 fields to put in the where clause.
> I have created the App. definition file and the application works with
> hard coded subscriptions - but I have not been able to figure out how
> to add condditions dynsmically to a subscription using the API.
> 
> 
> Any ideas on how to achieve this?
> 
> Thanks
> DK


<Prev in Thread] Current Thread [Next in Thread>