代码如下:string sTypes="select * from FileView where FirstType like '"%'+sfirstType+'%"' and SecType like '"%'+ssecType+'%"' and FileTitle like '"%'+sTitle+'%"'"; 是不是“”与‘’用得太频繁了?
有错误 string sTypes="select * from FileView where FirstType like '"%'+sfirstType+'%"' and SecType like '"%'+ssecType+'%"' and FileTitle like '"%'+sTitle+'%"'"; 字符从第一个"起始,再遇到"终止 "select * from FileView where FirstType like '" 是一个完整字符串,后面的%不是字符串运算符,错误
string sTypes="select * from FileView where FirstType like '%"+sfirstType+"%' and SecType like '%"+ssecType+"%' and FileTitle like '%"+sTitle+"%'";
正确的应该是这样: string sTypes="select * from FileView where FirstType like '%"+sfirstType+"%' and SecType like '%"+ssecType+"%' and FileTitle like '%"+sTitle+"%'";
string sTypes="select * from FileView where FirstType like '"%'+sfirstType+'%"' and SecType like '"%'+ssecType+'%"' and FileTitle like '"%'+sTitle+'%"'";
字符从第一个"起始,再遇到"终止
"select * from FileView where FirstType like '"
是一个完整字符串,后面的%不是字符串运算符,错误
string sTypes="select * from FileView where FirstType like '%"+sfirstType+"%' and SecType like '%"+ssecType+"%' and FileTitle like '%"+sTitle+"%'";