DataSet aDataSet = cnn.QueryDataset("select * from book_subject where primary_id='" + this.choosetype.SelectedValue + "'");
                this.DropDownList2.DataSource = aDataSet.Tables[0];
                this.DropDownList2.DataTextField = aDataSet.Tables[0].Columns[1].ToString();
                this.DropDownList2.DataValueField = aDataSet.Tables[0].Columns[2].ToString();
                DropDownList2.DataBind();

解决方案 »

  1.   

    把绑定放在
    if (!Page.IsPostBack)下
      

  2.   

    page_load里面加上
    if (!Page.IsPostBack)
    {
    DataSet aDataSet = cnn.QueryDataset("select * from book_subject where primary_id='" + this.choosetype.SelectedValue + "'"); 
                    this.DropDownList2.DataSource = aDataSet.Tables[0]; 
                    this.DropDownList2.DataTextField = aDataSet.Tables[0].Columns[1].ToString(); 
                    this.DropDownList2.DataValueField = aDataSet.Tables[0].Columns[2].ToString(); 
                    DropDownList2.DataBind();
    }
      

  3.   

    只唯的用 DataReader 即可,免得用 DataTable/DataSet 浪费许多内存。
    http://www.cnblogs.com/WizardWu/archive/2008/07/15/1243661.html