Connecting Tech Pros Worldwide Help | Site Map

Refresh browser if database table is altered

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 7th, 2009, 04:12 AM
Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Age: 25
Posts: 258
Default Refresh browser if database table is altered

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

Last edited by Frinavale; January 9th, 2009 at 01:24 PM. Reason: Moved from .NET to ASP.NET
Reply
  #2  
Old January 7th, 2009, 01:30 PM
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 6,720
Default

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?
Reply
  #3  
Old January 9th, 2009, 09:06 AM
Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Age: 25
Posts: 258
Default

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.
Reply
  #4  
Old January 9th, 2009, 09:58 AM
PRR's Avatar
PRR PRR is offline
Moderator
 
Join Date: Dec 2007
Location: The Matrix
Posts: 601
Default

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...?
Reply
  #5  
Old January 9th, 2009, 11:34 AM
Needs Regular Fix
 
Join Date: Dec 2006
Location: chennai
Age: 25
Posts: 258
Default

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.