"select * from table where bookname like '%" + textBox1.Text + "%'"
"select * from table where bookname like '" + textBox1.Text + "%'"
呀,这么简单的问题来个更高级的: string strKey = txtKey.Text.Trim().Replace(''',''''); //防止SQL攻击 strSql = "select * from table where bookname like '%"+strKey+"%' or bookAuthor like '%"+strKey+"%' or bookType like '%"+strKey+"%'"; ...
select * from table where bookname like 'ba%' or select * from table where bookname like '" + textbox.Text + "%'
严重同意楼上
string strKey = txtKey.Text.Trim().Replace(''',''''); //防止SQL攻击
strSql = "select * from table where bookname like '%"+strKey+"%' or bookAuthor like '%"+strKey+"%' or bookType like '%"+strKey+"%'";
...
or
select * from table where bookname like '" + textbox.Text + "%'