上面那个错误我已经解决了。我实现的是两个DropDownList的二级关联,现在数据都关联上去了,但第二个DropDownList不能实现动态联动,我怎么也看不出来是代码的那个地方有问题,请大家帮我看看:
    <script language="C#" runat=server>private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if (!IsPostBack)
{
SqlConnection conn = new SqlConnection("server=systemserver;database=RtsCase;user id=sa;pwd=systemserver");
conn.Open(); 
DataSet ds = new DataSet();
try
{
String strSQL="select * from specialtyTab ";
SqlDataAdapter objAdapter=new SqlDataAdapter(strSQL, conn);

objAdapter.Fill(ds,"AccountGp");

AccountGroup.DataSource=ds.Tables["AccountGp"].DefaultView;
AccountGroup.DataTextField = "specialtyName";
AccountGroup.DataValueField = "specialtyNum";
AccountGroup.DataBind();   //绑定组列表 ;
}
catch{}
BindAccount(ds,conn);
}
}protected void AccountGroup_SelectedIndexChanged(object sender, System.EventArgs e)
{

string strConnection = ConfigurationSettings.AppSettings["SQLConnectionString"];
SqlConnection conn = new SqlConnection(strConnection);
conn.Open(); 
DataSet ds = new DataSet();
BindAccount(ds,conn);

}private void BindAccount(DataSet dss,SqlConnection connn)
{

try
{
         
String strSQL1="select deviceSystemName from deviceSystemTab where fromSpecialtyNum='"+AccountGroup.SelectedItem .Value+"'";
SqlDataAdapter objAdapter1=new SqlDataAdapter(strSQL1, connn);

objAdapter1.Fill(dss,"CurAccount");
   
CurAccount.DataSource=dss.Tables["CurAccount"].DefaultView;
CurAccount.DataTextField = "deviceSystemName";
CurAccount.DataBind();   //绑定当前组成员列表;
}
catch{}

}   </script>        <ASP:DropDownList id=AccountGroup AutoPostBack=true SelectedIndexChanged="AccountGroup_SelectedIndexChanged" runat=server> 
        </ASP:DropDownList> 
      <ASP:DropDownList id=CurAccount  runat=server> 
        </ASP:DropDownList>