Auto Refresh update panel on page using Timer
Posted by Sujit Kumar on September 6, 2008
private void BindGridView()
{
string connectionString = @”Server=sujitkumar\sqlexpress;Database=pubs;uid=sa;pwd=1234;”;
SqlConnection conn = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter(“SELECT * FROM names”, conn);
DataSet ds = new DataSet();
ad.Fill(ds);
gvName.DataSource = ds;
gvName.DataBind(); //gvName is Gridview
}
protected void timer1_tick(object sender, EventArgs e)
{
BindGridView()
up1.Update(); //up1 is updatepanel object.
}