现在有一个textbox,里面可以输入关键字
比如:我想查找“上海徐汇区梅陇路”的用户
那我可以输入“上海、徐汇”
我怎么样用like语句来匹配呢?
string str="select * from t_Users where Address like"
str +=" '%"
str +=textbox1.text;
str += "%'";
这样不行啊,我想用like上海 and like徐汇 这样的语法,但是不知道应该怎么用啊
高人指点啊
多谢了

解决方案 »

  1.   

    string   str="select   *   from   t_Users   where   Address   like '%"+ textbox1.text +"%'查询上海、徐汇可以在textbox中输入上海%徐汇用百分号分割.
      

  2.   

    string   str="select   *   from   t_Users   where   Address   like '%"+ textbox1.text +"%'
      

  3.   

    string   str="select   *   from   t_Users   where   Address   like '%"+ textbox1.text +"%'"