用combobox来对数据库进行筛选?
用combobox绑定了数据库的一个字段,通过对combobox的选择来筛选数据库,在连接的适配器的查询器怎样编写条件?
例如 select * from table where 地区= " "
引号内怎么编写才能代表combobox1.text的内容?
[解决办法]
string sql= "select * from table where [地区]= ' "+ combobox1.text + " ' "
[解决办法]
VB这样:
dim sql as string = "select * from table where [地区]= ' "& combobox1.text & " ' "
晕了,嘿嘿
[解决办法]
SELECT * FROM line
where 地区= ' "+ combobox1.text + " '
这句中的等号(=),有问题吧
select * from line
where [地区] = ' "+ combobox1.text + " '
[解决办法]
combobox1.text
-->
this.combobox1.Text