当前位置: 代码迷 >> Sql Server >> 怎样给SQL语句中加入变量.该怎么处理
  详细解决方案

怎样给SQL语句中加入变量.该怎么处理

热度:46   发布时间:2016-04-27 20:54:30.0
怎样给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+ '% ' ";
  相关解决方案