I have a Timer and a GridView who pulls info from the database every X seconds.Every time I query the database the field 'Comments' is replaced with whatever is on the database (since it's bound to it).I'd like to keep my previous value and keep adding into my Label the subsequent values queried from the database.
For instance, first time I query I get a value of "1" in the Gridview. Now someone changes the database row and next time I queryit I have a value of "2". Well, I would like to concatenate the last value queried with the previous one and so on.
So at this point the GridView should show "1" and "2". Here is the piece of code I am talking about:
<asp:TemplateField HeaderText="Comments" SortExpression="Comments"> <ItemTemplate> <asp:Label ID="lblComments" runat="server" Text='<%# Bind("Comments") %>' /> </ItemTemplate></asp:TemplateField>
How do I achieve this goal?
View Complete Post