c#模糊查询出错
SqlConnection conn = new SqlConnection();conn.ConnectionString = "server=LUKE\\SQLEXPRESS;uid=sa;pwd=sa;database=luke";
conn.Open();
DataTable dt = new DataTable("resouce");
dt.Clear();
SqlDataAdapter adp = new SqlDataAdapter("select * from text1", conn);
adp.Fill(dt);
string sql = "select * from text1 where bh like %"+textBox1.Text+"%";
SqlCommand command = new SqlCommand(sql, conn);
SqlDataAdapter ad = new SqlDataAdapter();
ad.SelectCommand = command;
ad.Fill(dt);
dt.Clear();
dataGridView1.DataSource = dt.DefaultView;
我在textbox1中输入查询数字 2 提示出错