DropDownList1 的 AutoPostBack 属性的值改为 true

解决方案 »

  1.   

    this.DropDownList1.DataSource = ds.Tables["a"];
    这样看可以吗
      

  2.   

    用reader來做看看:
    Sub DropDownList_BindGrid()
        CmdSelect=new OleDbCommand("select * from class order by id",MyConnection)
        MyConnection.Open()
    dtrReader=CmdSelect.ExecuteReader() dropnews.DataSource=dtrReader
    dropnews.DataTextField="bigclass"
    dropnews.DataValueField="bigclassid"
    dropnews.DataBind()
    dropnews.Items.Insert(0,new ListItem("½Ð¿ï¾Ü",-1))
    dtrReader.Close()
    MyConnection.Close()
    End Sub