您好我现在编码的搜索框将从sql获取数据,并检查是否有任何此类数据,但是当我运行我的代码时
public void checkValues()
{
using (connection = new SqlConnection(connectionString))
using (SqlCommand cmdMovname = new SqlCommand("select Film_name from product where Film_name like'%the value here is not in the sql data %'", connection))
{
connection.Open();
if (cmdMovname.ExecuteNonQuery() != 0)
{
SetValues();
find = "Search result for \"the value here is not in the sql data\"";
}
else if (cmdMovname.ExecuteNonQuery() == 0)
{
find = "Sorry , no search result for \"the value here is not in the sql data\"";
}
}
}
find的字符串值将始终为“搜索结果为”,此处的值不在sql data \“”中 有人可以帮助我这个原因我是新手使用SQL数据库