首页 新闻 会员 周边

怎么将TextBox输入的信息放到sql语句中

0
悬赏园豆:5 [已解决问题] 解决于 2012-07-09 11:40

string sql = "select * from fruit ";

我想进行模糊查询,,,select * from fruit where name like '%TextBox输入的信息%'

觉信的主页 觉信 | 初学一级 | 园豆:66
提问于:2012-07-05 14:41
< >
分享
最佳答案
0
string value = TextBox输入的信息;
string sql = "select * from fruit where name like '%" + value + "%'";
收获园豆:5
dudu | 高人七级 |园豆:31007 | 2012-07-05 15:44
其他回答(3)
0

string params=this.textBox.Text;

select * from fruit where name like '%params%'

猪头猪脑 | 园豆:6 (初学一级) | 2012-07-05 14:54
0

楼上dudu正解。

jerry-Tom | 园豆:4077 (老鸟四级) | 2012-07-06 10:19
0

dudu都来了 

Shannon | 园豆:611 (小虾三级) | 2012-07-06 15:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册