+ "lineName = ?productLine " + "and isVisible = 1 "; MySqlDataAdapter adap = new MySqlDataAdapter(sql, msc); adap.SelectCommand.Parameters.Add("?productLine", productLine);
删除撇号(').
将@更改为?,这是MySql查询中参数的前缀.