Connecting Tech Pros Worldwide Forums | Help | Site Map

Refresh browser if database table is altered

Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Posts: 270
#1: Jan 7 '09
Hi Experts,

I have a senario and i am in need of your suggestions in this.
I have a database which is updated by a perl application. I use an asp.net page to display the data's in the database, and this page is accessing the database through a web service. For me this part is working fine. now i need to refresh my asp.net page is there occurs any change in the database (i.e., if the perl application alters the table it should get immediately reflected on my asp.net page). Timers can be used here but it is killing my resource as the database is huge.

Thanks in advance
karthi

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Jan 7 '09

re: Refresh browser if database table is altered


Hmm, have you considered having the browser do a little messaging behind the scenes to ask "has anything changed?" and it the server says "yes it has" refresh your asp.net page. If the server says "nope, nothing new" then you don't refresh the page?
Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Posts: 270
#3: Jan 9 '09

re: Refresh browser if database table is altered


Hi Plater,Thanks for the reply. but even then there will be a huge traffic to my database server as when ever the browser requests the server the database will be hit. Is there any possible way for using triggers to refresh my page either directly or indirectly.
PRR PRR is offline
Moderator
 
Join Date: Dec 2007
Location: India
Posts: 702
#4: Jan 9 '09

re: Refresh browser if database table is altered


You could use static System.Timers.Timer in your web service...The timer can periodically "scan" a table where updates from parent page are copied..(not the original table, guess its "HUGE". For this to work write a trigger which will fire on insert update and delete... the trigger should copy that changed data to a new table)... The new table entry can be updated in web service(cached dataset/datatable ) and a static bool variable set to true( meaning something has changed..so update).. Meanwhile your your client aspx page can query whether the static variable has changed or not? if yes updated...?
Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Posts: 270
#5: Jan 9 '09

re: Refresh browser if database table is altered


Hi DeepBlue,This idea sounds good let me try in your way.
Reply


Similar ASP.NET bytes