我需要根据下拉列表选择的值填充网格:我的 c# 编码是
protected void atddroplist_SelectedIndexChanged(object sender, EventArgs e)
{
empatdListBI c = new empatdListBI();
DbConnection b = new DbConnection();
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
DataSet ds = new DataSet();
if (atddroplist.SelectedIndex == 1)
{
b.OpenConnection();
dt = c.LoadRecords(empText.Text);
GridView1.DataSource = dt;
GridView1.DataBind();
b.CloseConnection();
}
}
使用此编码,我无法在输出中看到 Grid。请帮帮我