Ping sql server and track newly inserted rows
<p>I m developing simple multiuser chat application in asp.net c# for my website.I have a table name chat in database.i have a chat.aspx.cs page which contains getmessage() addmessage() methods.i created 1 class file which contains getpreviousmsgcount() and newmsgcount() methods which returns the Count of total records in Chat table.now what i did is i drag two timers on my chat aspx page.
on timer1 tick event i retrieve prevmsgcount() and timer2 tick event i retrieve newmsgcount(),timer1 tick event get fired before timer 2.And in timer 2 i applied a following logic
if(newmgcount>prevmsgcount)
then refresh a page(so getmessage() gets called again and new messages are added).But in this case i observed timers keep on refreshing page on time interval."if" condition is getting ignored.how to ping sql server continously and track insertion of new record?is der any other way without using timer controls?
<strong>Plz help with the code of C# and asp.net only.
Thanks in Advance.</strong>  </p>
