best way to push database changes using net.tcp communicationa and silverlight
What is the best way to push database chang开发者_如何学JAVAes to silverlight ui using net.tcp communications? Sql Notifications? query notifications, clr triggers? or just poll the database every so many seconds?? And would net.tcp be the solution?
See my answer to a very similar question here. Basically, it all depends on what your needs are. The simplest way would be to just poll the database. That may meet your needs if timing and/or performance and/or complexity aren't critical. But if you need a more scalable solution, then you probably want to use something like a SqlDependency object.
Once you know what data has changed, then yes, you would presumably send out notifications to the clients over a Net.TCP or HttpPollingDuplex binding.
And once the client has received its notification, then you'll need to implement a translation layer between the notification and the model and/or view model that's sitting behind the UI. There's no special magic here, just some careful coding to make sure that everything stays in sync.
Once the model/viewmodel is updated, you'll finally get to the point where XAML databinding will show its value, but unfortunately, that's only the last part of the solution.
精彩评论