Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Help with a dynamic record

Author  Topic 

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2009-07-02 : 14:00:15
Hi Group:

Here is my dilema, I am pulling from a database a list of Users. I am using the list as part of an Application and showing the list of users in a drop down list.
Here is the dilema, I need to put Select as the first choice in that drop down list instead of the user name ex. Adams, Joe.
----
Problem is I tried to set that inside the ddl properties on Collection = "Select" True default. (doesn't work)
I also tried to have it in the Vb.Net code as ddlExample.Items.Insert(0, "Select") it doesn't work.
------
So, my only hope is to do it on the SQL side on the Selection criteria that right now is as follow:
SELECT displayName, mail FROM GSP_LDAP_data WHERE (displayName NOT LIKE '_IT%') AND (displayName NOT LIKE '3%') ORDER BY displayName

I appreciate your help. Basically, I want to some how dynamically on that select statement create a record that shows "Select".

Thank you.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-02 : 14:04:48
I strongly think you can do this in vb.net but i cant guide you on it as i dont know .net

In sql, you will do like this

SELECT displayName, mail
FROM
(
SELECT displayName, mail,1 AS SortOrder FROM GSP_LDAP_data WHERE (displayName NOT LIKE '_IT%') AND (displayName NOT LIKE '3%')
UNION ALL
SELECT 'Select',NULL,0
)t
ORDER BY SortOrder,displayName
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2009-07-02 : 14:38:22
Thank you visakh16
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-05 : 03:19:21
welcome
Go to Top of Page
   

- Advertisement -