Avoid getting NULL value

if(!IsPostBack){

//code here

}

Anuncios

Clear GridView

GridView1.DataSource = null;

GridView1.DataBind();