fellow devs! I need to know 开发者_Go百科a strategy that will allow me to know that the database has been updated so that I can rebind respective controls (DropDownLists in this case. Here is a bit more details:
I have three Combo-Boxes (DropDownLists) on a MDI Parent form. Selecting a value from these combos will allow me to directly jump to the view form for the selected entity. Now, on MDI parent load, these combos are filled up. But once the application is running, anyone from anywhere can edit an entity or add a new one. i need to detect this and somehow cause the combo(s) to reload again.
Using Linq-2-SQL to load the Combos, Backend is a SQL 2005 DB on a SQL 2008 Server.
There's no builtin functionality to do all of this, so you'll have to roll your own.
One possibility I can see is to have a timer that periodically checks whether the items have been updated. You could do this by storing a last updated timestamp somewhere and checking against it. When you detect that the items changed, requery the data and rebuild the combos.
didn't try it, but you may take a look at the Sql Service Broker feature.
From my memory, it can create a file on the file system and you can monitor the creation of this file.
it's the feature used by the ASP.Net cache and its dependencies check.
精彩评论