string sql = "select * from [Table] where ID"+Convert.Int32(DropDownList.SelectValue)
............
GridView1.DataSource=ds;
GridView1.DataBind();

解决方案 »

  1.   

    没听明白, 可能你是想说 dropdownlist 中选择一个部门,gridview 中就出现这个部门的所有员工, 是这个意思吗?
      

  2.   

    DropDownList1的autoPostBack设置为true,双击它的事件写bind定
      

  3.   

    把DropDownList的autoPostBack设置为true,再写个根据DropDownList所选中的值查寻数据库里的方法。
    代码如下:
    string str = DropDownList.SelectItem.Values.ToString();
    string sql = "select * from tableName where 数据库里的字段名的值='"+ str +"'";
    最后再让你的GridView重新调用DataBind()这个方法就可以了。
    ^_^