搜索组合框的内容并在其文本上显示 [英] Search items of combobox &display on its text
本文介绍了搜索组合框的内容并在其文本上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在组合框上搜索文本并在其文本上显示
[edit]已删除呼喊声-OriginalGriff [/edit]
Search text of combobox &display on its text
[edit]SHOUTING removed - OriginalGriff[/edit]
推荐答案
尝试以下代码:
Try to below code:
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()
这篇关于搜索组合框的内容并在其文本上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文