Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi every body,

I need to find a way to do something like what SqlDependency doing in my winform application.
I mean that i want to notified when the specified table is changed, so i can refresh my presentation layer with updated data.

I can not use sqldependency because of it's long list of limitations.

please help me...
Posted
Comments
Maciej Los 16-Sep-13 5:03am    
What kind of limitations?
M_Mogharrabi 16-Sep-13 5:18am    
The main problem is with it's limitation on OUTER JOIN command.I have to use this command in a lot of my queries.
leonidasvijay 16-Sep-13 6:00am    
why don't you use timer_tick event?
M_Mogharrabi 16-Sep-13 6:29am    
Because i want to refresh my forms immediatly after the table is updated however Timer maybe has a delay.also my application should work on a local network with maybe many clients so Timer can busy the network!

You can use Timer to check for every frequent time...Place your table in session and get the latest...Compare the two and finalize your Presenatation layer
 
Share this answer
 
Comments
M_Mogharrabi 17-Sep-13 1:53am    
Hi Rajesh Gelli and Thanks.
See i have about 50 tables in my application that can update in run time and i want to notify immediatly when each of them is updated.
So do you think placing these 50 tables in session is correct?
Again do you think that comparing a table with it's previous session in every 1seconds(Timer interval) does not decrease the speed of application?
we can do through service brokers and with snap shots isolation. Please check below links for information

http://stackoverflow.com/questions/5288434/how-to-monitor-sql-server-table-changes-by-using-c[^]
http://msdn.microsoft.com/en-us/library/cc305322.aspx[^]
 
Share this answer
 
Comments
Rajesh Gelli 16-Sep-13 7:59am    
You can use Timer to check for every frequent time...Place your table in session and get the latest...Compare the two and finalize your Presenatation layer
SqlCommand cmd = xxx
cmd.Notification = null;
SqlDependency dependency = new SqlDependency(cmd);
dependency.OnChange += OnChange;
 
Share this answer
 
Comments
M_Mogharrabi 17-Sep-13 1:31am    
Thanks Balamurugan, but i think you did not read my question completely,I said in my question that "I can not use sqldependency because of it's long list of limitations"! I have used OUTER JOIN command in a lot of my queries while it is one of the Constraints of sqldependency.
 
Share this answer
 
Comments
M_Mogharrabi 17-Sep-13 1:32am    
Thanks Rakesh Meel, but i think you did not read my question completely,I said in my question that "I can not use sqldependency because of it's long list of limitations"! I have used OUTER JOIN command in a lot of my queries while it is one of the Constraints of sqldependency.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900