//
string strSel = "select * from CustomerData where " + datafiled + " like '%" + keyWords + "%' and userName='" + userName + "' order by id asc";
//
//
现改为如下这样却出错了:
OleDbParameter[] parameters = {
new OleDbParameter("@datafiled", datafiled),
new OleDbParameter("@keyWords", keyWords),
new OleDbParameter("@userName", userName),
};
string strSel = "select * from CustomerData where @datafiled like '%@keyWords%' and userName=@userName order by id asc";