【发布时间】:2015-02-21 03:13:02
【问题描述】:
我希望在输入 TextBox1 时,combobox1 根据 TextBox1 进行过滤。 我该怎么做? 这是我的代码:
>>>The TextBox1 entered like this:
Textbox1.text = 2015-02
>>>This is load the ComboBox
cmd = New OleDbCommand("Select * from TABLE where COL1 = TextBox1.Text", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
COMBOBOX1.Items.Add(rd.Item(0))
Loop
>>>It work when I write like this:
cmd = New OleDbCommand("Select * from TABLE where COL1 = '2015-02'", Conn)
rd = cmd.ExecuteReader
Do While rd.Read
COMBOBOX1.Items.Add(rd.Item(0))
Loop
>>> But i wanna the COL1 according by TextBox1.Text
【问题讨论】:
标签: vb.net combobox connection