views:

161

answers:

1

Hi All,

I have a scenario to update Winforms application GUI when ever there is a data change in database table.Is any body using SQL Service broker to do same?

For example:

I have a customer and order tables in SQl Server 2005 database and I have winform(WPF) application which resides on Call Center executives(say CCE-A,CCE-B,CCE-C,CCE-D) desks to show pending customer orders.

All those Call Center Executives will process pending orders simultaniously.As a developer my challenge is update Call Cener Executives GUIs when ever there is a change in Customer and Order tables.

Thanks in advance for your valuable time.

+1  A: 

It really depends on the number of GUI's that you would have to be updating. Essentially, the SqlDependency works of ServiceBroker to fire updates to the application when data changes in the database, so your could use it, or roll your own implementation, but the caveat is that it isn't good for large scale/multi-dependency refreshes because of the overhead of each Dependency. Pro SQL Server 2008 Service Broker by Klaus Aschenbrenner is a great reference for how you can use service broker with managed code.

You can create a single test SqlDependency on the data you want to watch, and use SQLTrace to capture the statements executed by the Database Engine to create the Service and Queues in SQL Server. Then you can take those statements and use them as the basis for a customize Service to meet your needs, having the clients setup to use the same Service instead of each starting their own through SqlDependency. This along with an ObservableCollection in WPF should get your to where you need to be.

Jonathan Kehayias
Thank you very much Jonathan. You provided me an excellent information. I have to digg on to more based on your information.
porhills