adding information to a dropdownlist from mssql databas

Discussion in 'ASP .Net Web Controls' started by Lennie, Dec 15, 2003.

  1. Lennie

    Lennie Guest

    Hello.



    i have tree dropdownlist that i want to add some information from a databas.

    The sql questions is like this for the tree dropdownlist┬┤s



    SELECT distinct eventuser

    FROM syslog..tblsecurityEvents

    where eventuser like 'PHONERA%' and eventuser not like '%$'



    SELECT distinct eventuser

    FROM syslog..tblsecurityEvents

    where eventuser like 'PHONERA%' and eventuser like '%$'



    SELECT distinct eventuser

    FROM syslog..tblsecurityEvents

    where eventuser not like 'PHONERA%'



    but.. I don't want to make 3 dataset.

    Can I just do one dataset like this.



    SELECT distinct eventuser

    FROM syslog..tblsecurityEvents



    And the use some type off dataview or something else to sort the information
    on the right dropdownlist.



    The code I am using right now is something like



    Dim show_users As SqlDataAdapter = New SqlDataAdapter("SELECT distinct
    eventuser FROM syslog..tblsecurityEvents where eventuser like 'PHONERA%' and
    eventuser not like '%$'", connect1)



    show_users.Fill(PortalData, "eventuser")



    DropDownList1.DataSource = PortalData

    DropDownList1.DataMember = ("eventuser")

    DropDownList1.DataTextField = ("eventuser")

    DropDownList1.DataBind()



    // Lennie

    Phonera.se
     
    Lennie, Dec 15, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z. f.
    Replies:
    0
    Views:
    684
    z. f.
    Feb 3, 2005
  2. Replies:
    0
    Views:
    313
  3. Replies:
    4
    Views:
    280
    Peter Otten
    Oct 17, 2008
  4. JB
    Replies:
    1
    Views:
    349
    James Irvine
    Jun 11, 2010
  5. MilanB
    Replies:
    1
    Views:
    130
    Joe Kaplan \(MVP - ADSI\)
    May 10, 2005
Loading...

Share This Page