Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear mentors,

i am monitoring two sqlserver tables from one form and showing those data in two different datagrids and few labels. Problem is the form responses slowly i.e. if i move it.

did i mistake anything? what should be the smart policy to use sqldependency?

SKPaul
Posted

1 solution

By 'form responses slowly i.e. if I move it' do you mean when dragging the form across the screen?
If so I'm guessing you are constantly (or at least several times a minute) polling the database and processing the data.

This causes the GUI thread to be 'busy'.

To avoid this you'll have to use threading and pass the data to the form.

Look in to threading and delegates (do some research if your not familiar with it).

Other than that the only way would be to prevent any user action while you are processing the data (but that's not very user-friendly).
 
Share this answer
 
Comments
Saumitra Kumar Paul 27-May-11 5:59am    
there are threads. But still i face that probs. any thing more? thank you for your reply,
Tom Deketelaere 27-May-11 7:30am    
Without a better explanation of what your doing and how exactly (some code snippets) I couldn't say.
Saumitra Kumar Paul 27-May-11 6:02am    
Is there any method to set the database polling rate per minute?

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