Connecting Tech Pros Worldwide Forums | Help | Site Map

How to refresh a form on a database change?

Newbie
 
Join Date: Sep 2007
Posts: 7
#1: Jan 29 '08
I've got an application that I can't use a tradtional database trigger on because of performance issues.

I would like to refresh the page /form when data changes on a certain field in the database.

I realize that asp.net is stateless, but is it possible to poll the database using javascript every x number minutes then have it refresh if the value changes?

thanks in advance.

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Jan 29 '08

re: How to refresh a form on a database change?


Quote:

Originally Posted by walterb

I've got an application that I can't use a tradtional database trigger on because of performance issues.

I would like to refresh the page /form when data changes on a certain field in the database.

I realize that asp.net is stateless, but is it possible to poll the database using javascript every x number minutes then have it refresh if the value changes?

thanks in advance.

Javascript doesn't connect to databases. You'd need to use AJAX.
Newbie
 
Join Date: Sep 2007
Posts: 7
#3: Jan 29 '08

re: How to refresh a form on a database change?


Thanks. Do you have a link to any examples of ajax code testing a database condition?

Quote:

Originally Posted by r035198x

Javascript doesn't connect to databases. You'd need to use AJAX.

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#4: Jan 29 '08

re: How to refresh a form on a database change?


Quote:

Originally Posted by walterb

Thanks. Do you have a link to any examples of ajax code testing a database condition?

You'd have to ask in the Javascript forum. You'd need to do your server side scripting all the same. Only this time you send the result to an Ajax function which inturn passes it to a Javascript function which (sigh) can update the page details without the page having been (visibly) submitted.
Reply