adding information to a dropdownlist from mssql databas

L

Lennie

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top