I have a winform application which needs to consume a web service. Web service checks in the database for any changes. If there are any changes
SignalR allows you to implement Web Services to do this very thing, in real time (no need for a timer or delay between updates). It allows you to set up a persistent connection between client and server, the server is then able to send messages to the client at any point using a stack of transports; WebSockets, Server Sent Events, Forever Frame and Long Polling) based on support available in that order.
You could use SignalR to establish the connection and when something happens on the Server (such as the change in the database you mentioned) broadcast to all clients that need to be notified. eg.
Clients.All.notifyDatabaseChanged(args);
That's the only way especially if the web service is not WCF-based or if you can't afford to modify it.
If you're using a timer just make sure you use System.Timers.Timer and follow the instructions here so that the Elapsed
handler is executed on the UI thread. Moreover, when the timer ticks you should probably spawn a worker thread (or Task, or await on an async method) that makes the service call. You don't want your UI to be blocked while the service call is in progress.
If you have control over the web service, then you may want to explore WCF Duplex Services, which allow you to callback clients from within services.