ListItem li=new ListItem(DataSet.Tables[0].Rows[0]["asd"].ToString(),DataSet.Tables[0].Rows[0]["asd"].ToString());
//前面是Text,后面的是value
DropDownList1.Items.add(li);

解决方案 »

  1.   

    可以实现的。这个问题就是先把这个字段的值放入ListItem中,然后再绑定。
      

  2.   

    “ListItem”是一个类型,不能用作表达式。
      

  3.   

    Easy:
    string sql3="select * from aa";
    SqlCommand cm3 = new SqlCommand(sql3, cn);
    SqlDataReader dr3=cm3.ExecuteReader();
    DropDownList4.DataSource=dr3;
    DropDownList4.DataTextField="usertypems";
    DropDownList4.DataValueField="usertypeid";
    DropDownList4.DataBind();
    dr3.Close();