sql语句中提示错误 字符文本中的字符太多?帮忙看看错在哪里?代码如下:

来源:百度知道 编辑:UC知道 时间:2024/06/04 07:51:40
string cmdtext = "select realname,role_name,role_description from staff"
+ "inner join staffrole on staff.staff_id=staffrole.staff_id"
+ "inner join role on role.role_id=staffrole.role_id"
+ "where staff_name="+'""+susername+""';

string cmdtext = "select realname,role_name,role_description from staff"
+ "inner join staffrole on staff.staff_id=staffrole.staff_id"
+ "inner join role on role.role_id=staffrole.role_id"
+ "where staff_name='"+susername+"'";

你把那些加号去掉试试