Asp.net怎么用like关键字实现简单的站内搜索??
答案:3 悬赏:0 手机版
解决时间 2021-03-03 03:13
- 提问者网友:你给我的爱
- 2021-03-02 10:44
希望可以详细点!在数据库中要存入什么??回答多多益善
最佳答案
- 五星知识达人网友:野慌
- 2021-03-02 11:04
查询的结果用 union all 连起来。因为你要查几个表。
select col1 as 1 ,col2 as 2, 'aaaaaa' as 3 from t1 where '''
union all
select Bcol1 as 1 ,Bcol2 as 2, 'aaaaaa' as 3 from t2 where ''
可以多联几个表,看你想查哪些都可以 'aaaaa' 表示如果 前台想点查看 跳转的url.
select col1 as 1 ,col2 as 2, 'aaaaaa' as 3 from t1 where '''
union all
select Bcol1 as 1 ,Bcol2 as 2, 'aaaaaa' as 3 from t2 where ''
可以多联几个表,看你想查哪些都可以 'aaaaa' 表示如果 前台想点查看 跳转的url.
全部回答
- 1楼网友:玩家
- 2021-03-02 12:21
string strSql="select * from tableName where columnName like %'"+textbox1.Text+"'%";
连接数据库,执行这条sql语句就行了。
- 2楼网友:第幾種人
- 2021-03-02 12:12
库中要存信息的关键字,
每条可被搜索的信息都加一个关键字字段,
like这个字段即可。
再看看别人怎么说的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯