I have a page in my website which view life information(like bourse info) from database What I want is : refresh a part of the page through the AJAX technics When a new row is added to one of the tables in the database.
If you want to go the Microsoft route, you might want to start by watching a few of these tutorials that'll get you started with ASP.NET AJAX: http://www.asp.net/learn/ajax
So to be clear: when something in the database changes, you want everyone viewing a page on your site that is displaying that data to be refreshed with the addition? This is the opposite direction of how AJAX typically works (something changes on the user's end and the application is notified).
What you could do is add code to do an AJAX postback every x seconds (30 seconds let's say) with an AJAX Timer. That way only that part of the page is updated (AJAX style) and the user only has a lag of 30 seconds between data update and display. Here is an example of what I mean.
The technique you should employ is "Polling"
You cannot have notifications from server to client in this situation, so you need to keep polling to server at every X seconds, asking the server "Do you have any new Data ?"
Let there be 2 AJAX enabled services in your appliction.
One should be polled at every X seconds asking the DB status. This service should return true in case there's any new data inserted in the database since last poll.
If the result from first service call is true, then you should call the Second service which will return you with the Newly inserted Rows or results in XML or any other format, which you can display comforatbly on your Page.
However, you must keep track of last polling request by its datetime of request. Everytime you send a polling request, you should also pass the DateTime of your last poll so that your service can check if there's any new data added after the last poll and return true only if there's any new data inserted after last poll. The same logic should be applied to Second service as well.
Thanks.
you can make webservice that will check from server, if there is any change happen, and update information accordingly.....