Click here to Skip to main content
15,912,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi

i want to add when we run application then value is reterieve from database and show in combobox ok , but i want to add combo box index 0 = select by default at run time


i think it depend upon query like :

select 'select', state from demotable

so above query is not working so give me any solution
Posted
Comments
Mohan Gopi 27-Aug-13 6:03am    
After finish your adding the combobox values finally give the below line

Combobox1.Items.Insert(0, "----Select----");

I hope this will help you, let me know.
pravin from aurangabad 27-Aug-13 7:27am    
thanx

but i want to place "select" in query not in combobox item collection
Mohan Gopi 27-Aug-13 8:08am    
you can try this

Select State from demoTable
Union
Select 'Select' AS 'State'
pravin from aurangabad 27-Aug-13 8:15am    
yes i try this but the select text appears at bottom combobox list .not in top
Mohan Gopi 27-Aug-13 8:16am    
try this
Select 'Select' AS 'State'
Union
Select State from demoTable

1 solution

Hi Pravin, try this

SQL
Select 'Select' AS 'State'
Union
Select State from demoTable


I hope this will help you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900