我有一个sql语句如下:
public DataTable loadData(string str)
{
string sql = @"SELECT TOP 1 a.*, b.idCoQuanQuanLy, c.NgayHuong, d.Bac, d.HeSo, e.Ngach, e.idNgach
FROM tbCanBo AS a INNER JOIN tbCoQuanSuDung AS b ON a.idCoQuanSuDung = b.idCoQuanSuDung
INNER JOIN tbQuaTrinhLuong AS c ON a.idCanBo = c.idCanBo
INNER JOIN tbHeSoLuong AS d ON c.ID = d.ID
INNER JOIN tbNgach AS e ON d.idNgach = e.idNgach
WHERE a.idCanBo = '"+str+"'ORDER BY c.NgayHuong DESC";
return conn.GetDataTable(sql);
}
如果数据库的值是序列号,我可以查询成功,如果我收到消息
“无效的列名'值'。”