I have to implement client server based app where client is windows app. Now, my plan is to create a webservice as a server app and use it in our client app. But the problem is in notification. For this, I need to add a timer to the client app to check for the notification. It slows down the client app.
What is the best approach to do this?
I need to create setup for both app. So, the solution must be deploy-able.
Edit: I can't put timer in background or seperate thread because I have to update datagridview immediately.
Use a BackgroundWorker or the Threadpool.QueueUserWorkItem for your calls to the webservice, then update your GUI. Your app slows down because you are calling the webservice from the main UI thread so your application cannot handle other events until the webservice call is done, that includes repaint, resize, clicks...
See this document : http://msdn.microsoft.com/en-us/library/ms951089.aspx
You want to update immediately by calling a remote resource? I'm afraid that isn't possible unless we dump one of the laws of thermodynamics and allow for time travel.
BUT you can cheat and prefetch your data and bind it behind the scenes every XXX seconds.
Remember to use BeginUpdate and EndUpdate when updating your grid so you don't get any flicker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With