我的问题是,我制作了一个子表单进行搜索,但是我的 sql 查询和参数有问题,我的代码是
SqlConnection sc = new SqlConnection(
"Data Source=MOHAMMED-PC;Initial Catalog=salessystem;Integrated Security=True");
SqlCommand command = new SqlCommand(
"Select * from customers WHERE (docno = @doc) OR (NAME LIKE @name ) OR (salepoint = @salepoint)", sc);
DataTable dt = new DataTable();
command.Parameters.AddWithValue("@doc", doctxt.Text);
command.Parameters.Addwithvalue("@name", nametxt.Text);
command.Parameters.AddWithValue("@salepoint", salepointtxt.Text);
SqlDataAdapter sda = new SqlDataAdapter(command, sc);
sda.Fill(dt);
dataGridView1.DataSource = dt;
我在 sql 适配器命令和 where 子句命令中有错误,有什么帮助吗?