读出DataSetdropdownlist1.DataSource = ds.Tables[0].DefaultView;
dropdownlist1.DataTextFiled = "Area";
dropdownlist1.DataValueFiled = "Area";
dropdownlist1.DataBind();

解决方案 »

  1.   

    MyDropDownList.DataSource=yourdatatable.DefaultView;;
    MyDropDownList.DataTextField="Area";
    MyDropDownList.DataValueField="Area";
    MyDropDownList.DataBind();
      

  2.   

    将数据读出来绑定
    DropDownList1.DataSource=ds.Tables[0].DefaultView;;
    DropDownList1.DataTextField="Textxxx";
    DropDownList1.DataValueField="valuexxx";
    DropDownList1.DataBind();
      

  3.   


            Dim DT As DataTable
            Dim DR As DataRow
            DT = New DataTable("DT")
            DT.Columns.Add("key", GetType(String))
            DT.Columns.Add("value", GetType(String))        DR = DT.NewRow
            Dim strSQL As String = “your sql string ”
            conn.Open()
            Dim sqlDBcmd As SqlCommand = New SqlCommand
            sqlDBcmd.Connection = conn
            sqlDBcmd.CommandText = strSQL
            Dim DBreader As SqlDataReader = sqlDBcmd.ExecuteReader()
            While DBreader.Read()
                DR(0) = DBreader.Item(0)
                DR(1) = DBreader.Item(1)
                DT.Rows.Add(DR)
                DR = DT.NewRow
            End While
            DBreader.Close()MyDropDownList.DataSource=DT
    'to dongchuanlu(匡奇),这里无需.defaultview
    MyDropDownList.DataTextField="key";
    MyDropDownList.DataValueField="value";
    MyDropDownList.DataBind();
      

  4.   

    可以在属性栏里制定DataTextField与DataValueField绑定数据
    然后
    DropDownList1.DataSource=ds.Tables[0].DefaultView;;
    DropDownList1.DataBind();
    就可以了
      

  5.   

    MyConnection8 = New SqlConnection(dbconn)
    VoteItemStr = "SELECT * FROM play_voteItem"
    VoteItemCmd = New SqlDataAdapter(VoteItemStr,MyConnection8)
    DS8 = New DataSet()
    VoteItemCmd.Fill(DS8,"items")
    VoteItemDataList.DataSource = DS8.Tables("items").DefaultView
    VoteItemDataList.DataBind()
    MyConnection8.Close()