日期:2014-05-19  浏览次数:20535 次

怎样给SQL语句中加入变量.急急急!
变量:string   str   =   this.textbox.text;
string   strSelect   =   "select   *   from   table   where   name   like   ??? "

怎样把变量str     加入到???处         谢谢!!

------解决方案--------------------
string str = this.textbox.text;
string strSelect = "select * from table where name like ' ' "+str+ " ' ' ";
------解决方案--------------------
string strSelect = "select * from table where name like ' '+str+ '% ' ";