查询的结果用 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.
库中要存信息的关键字,
每条可被搜索的信息都加一个关键字字段,
like这个字段即可。
string strSql="select * from tableName where columnName like %'"+textbox1.Text+"'%";
连接数据库,执行这条sql语句就行了。