System.Data.DataView myDv=....
this.DropDownList.DataSource=myDv;
this.DropDownList.DataFieldtext="a";
this.DropDownList.DataFieldvalue="b";
this.DropDownList.DataBind();

解决方案 »

  1.   

    你的DataReader 有没有数据?
    在你绑定数据源前要 YouDataRreader.Read()一下;
      

  2.   

    DropDownList.DataSource=commom.ExecuteReader();
    DropDownList.DataFieldText="building"
    //DropDownList.DataFieldValue="building"
    DropDownList.DataBind();
      

  3.   

    string strSql = "Select distinct building From  switch";
    Conn.Open();
    Cmd =new OleDbCommand(strsql,Conn);
    OleDbDataReader Rd = Cmd.ExecuteReader();
    list.DataSource=Rd;
    list.DataTextField="building ";
    list.DataValueField="building ";
    list.DataBind();
    Rd.Close();
    Conn.Close();