DropDownList1.DataSource =getParent().Tables[0].DefaultView;
DropDownList1.DisplayMember = "zone_name";
DropDownList1.ValueMember = "zone_name";

解决方案 »

  1.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    DropDownList1.DataSource=getParent();
                                DropDownList1.DataTextField="zone_name";
                                //DropDownList1.DataValueField="id";
    DropDownList1.DataBind();
    }
      

  2.   


    DropDownList1.DataSource = ds.Tables["tables"];
    DropDownList1.DataTextField = "LoginName";
    DropDownList1.DataValueField = "id";
    DropDownList1.DataBind();