User-1123701243 posted
Hello
I have a page containing a Gridview and some other items. The gridview is getting data from database.
<asp:UpdatePanel ID="uplCheck" runat="server" class="updatepanel">
<ContentTemplate>
<asp:GridView ID="gvwData" runat="server" DataSourceID="sdsTweets" AutoGenerateColumns="false" CssClass="gvwTweets" AllowPaging="true" PageSize="50">
<Columns>
<asp:TemplateField HeaderText="م">
<ItemTemplate>
<%# Container.DataItemIndex + 1 %>
</ItemTemplate>
<ItemStyle Width="5%" />
</asp:TemplateField>
<asp:BoundField DataField="T_ID" HeaderText="userID" />
<asp:BoundField DataField="T_User" HeaderText="UserName" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="sdsTweets" runat="server"
ConnectionString="<%$ ConnectionStrings:TA %>" ProviderName="<%$ ConnectionStrings:TA.ProviderName %>">
</asp:SqlDataSource>
The code behind to bind the grid view is as follows:
Private Sub Fill_GridView()
sdsData.SelectCommand = "select * from Table1 "
gvwData.DataBind()
End Sub
I call the Fill_GridView at Page_Load event and every thing is fine.
My table1 is getting updated from another application and the records are changing.
I want to keep refreshing the gridview periodically (every 20 seconds) without refreshing the page.
I played with threading , update panels but I don't know what is wrong.