Dropdown list not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Binod Nair

    #1

    Dropdown list not working

    Hi All,

    This is what I am trying to do.I have an aspx page with the the following
    code block.

    <asp:DropDownLi st id="DropDownLis t1" runat="server" DataSource="<%#
    GetUsers%>" DataTextField=" user_email" DataValueField= "user_id">
    </asp:DropDownLis t>

    GetUsers is defined in the .vb file

    Public Function GetUsers() As DataSet

    Dim ds As DataSet
    ds =
    SqlHelper.Execu teDataset(Confi gurationSetting s.AppSettings(" ConnectionStrin g
    "), CommandType.Tex t, "select user_id , user_email from users")
    Return ds

    End Function


    I am kind of frustrated that I cannot make this thing work.What am I doing
    wrong ?

    --binod


  • Patrick Steele [MVP]

    #2
    Re: Dropdown list not working

    In article <OKAjILH3DHA.53 6@tk2msftngp13. phx.gbl>, nairbinod@hotma il.com
    says...[color=blue]
    > Hi All,
    >
    > This is what I am trying to do.I have an aspx page with the the following
    > code block.
    >
    > <asp:DropDownLi st id="DropDownLis t1" runat="server" DataSource="<%#
    > GetUsers%>" DataTextField=" user_email" DataValueField= "user_id">
    > </asp:DropDownLis t>
    >
    > GetUsers is defined in the .vb file
    >
    > Public Function GetUsers() As DataSet
    >
    > Dim ds As DataSet
    > ds =
    > SqlHelper.Execu teDataset(Confi gurationSetting s.AppSettings(" ConnectionStrin g
    > "), CommandType.Tex t, "select user_id , user_email from users")
    > Return ds
    >
    > End Function
    >
    >
    > I am kind of frustrated that I cannot make this thing work.What am I doing
    > wrong ?[/color]

    Are you ever calling DataBind()?

    --
    Patrick Steele
    Microsoft .NET MVP

    Comment

    Working...