Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > adding information to a dropdownlist from mssql databas

Reply
Thread Tools

adding information to a dropdownlist from mssql databas

 
 
Lennie
Guest
Posts: n/a
 
      12-15-2003
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






 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent size of web controls from changing after accessing databas JB ASP .Net 1 06-11-2010 06:56 AM
no mistake but i didnt get what i want (with python module pymssqlsend information to the mssql) gdyren@gmail.com Python 4 10-17-2008 11:38 AM
Databas closing issue francan00@yahoo.com Java 0 10-16-2007 04:07 AM
Directions for quering local SAM (user and groups account) databas MilanB ASP .Net Security 1 05-10-2005 03:49 PM
DBI problem inserting html into mssql db Kristian Perl 0 11-13-2003 12:23 PM



Advertisments