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

recurring notifications

Subject: recurring notifications
From: "skg"
Date: Fri, 10 Mar 2006 11:27:40 -0600
Newsgroups: microsoft.public.sqlserver.notificationsvcs
i am finding the notification is triggered only once when the field changes 
first time. Its not triggered second time. How can i have it trigger 
everytime there is a change in the field.

Here is code snippet. thx

...

..static void Main()

{

SqlCommand cmd = new SqlCommand("SELECT au_id, au_lname FROM dbo.authors", 
conn))

SqlDependency depend = new SqlDependency(cmd, null,0);

depend.OnChange += new OnChangeEventHandler(MyOnChanged);

conn.Open();

SqlDataReader rdr = cmd.ExecuteReader();

...

...

}

MyOnChanged(object caller, SqlNotificationEventArgs e)

{

Console.WriteLine("result has changed");

Console.WriteLine("Source " + e.Source);

Console.WriteLine("Type " + e.Type);

Console.WriteLine("Info " + e.Info);

}




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