select * from table where bookname like '%ba%'

解决方案 »

  1.   

    select * from table where bookname 'ba%'
    严重同意楼上
      

  2.   

    select * from table where bookname like 'ba%'
      

  3.   

    "select * from table where bookname like '%" + textBox1.Text + "%'"
      

  4.   

    "select * from table where bookname like '" + textBox1.Text + "%'"
      

  5.   

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

  6.   

    select * from table where bookname like 'ba%'
    or
    select * from table where bookname like '" + textbox.Text + "%'