Refresh browser if database table is altered

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthi84
    Contributor
    • Dec 2006
    • 270

    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; Jan 9 '09, 02:24 PM. Reason: Moved from .NET to ASP.NET
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    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?

    Comment

    • karthi84
      Contributor
      • Dec 2006
      • 270

      #3
      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.

      Comment

      • PRR
        Recognized Expert Contributor
        • Dec 2007
        • 750

        #4
        You could use static System.Timers.T imer 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...?

        Comment

        • karthi84
          Contributor
          • Dec 2006
          • 270

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

          Comment

          Working...