幕布斯7119047
将你的数据绑定方法放在查询按钮的单击事件里面调用就可以了。private void BindDate(){DataTable dt = new DataTable();dt.Columns.Add("ID", typeof(int));dt.Columns.Add("Name", typeof(string));dt.Rows.Add(1, "zhang");dt.Rows.Add(2, "zhao");dt.Rows.Add(3, "jia");dt.Rows.Add(4, "li");this.GridView1.DataSource = dt;this.GridView1.DataBind();}protected void Unnamed1_Click(object sender, EventArgs e){BindDate();}