Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Search text of combobox &display on its text

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 22-Feb-12 8:00am
v4
Comments
Orcun Iyigun 22-Feb-12 13:31pm    
You have to address the issue? Elaborate it more.. And please follow the basics of "How to ask questions in Q&A" !!
OriginalGriff 22-Feb-12 14:00pm    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
Isuru Nanayakkara 23-Feb-12 13:12pm    
you need to show your code first.
Chuck N0rris 24-Feb-12 11:51am    
Where is your code? show us

1 solution

Try to below code:
VB
 Dim oda As OleDbDataAdapter = New OleDbDataAdapter
con = New OleDbConnection("..........")
 con.Open()
 oda.SelectCommand = New OleDbCommand
 oda.SelectCommand.Connection = con
 oda.SelectCommand.CommandText = "select * from Tablename"
 Try
     dr = oda.SelectCommand.ExecuteReader
 Catch ex As Exception
     MessageBox.Show(ex.ToString)
 End Try
 ComboBox1.Items.Clear()
 While dr.Read
     ComboBox1.Items.Add(dr.Item(0))
 End While
 dr.Close()
 
Share this answer
 

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