这段有什么语法错误吗?

string strsql = "update t_user set password='" + user.Password + ",name='" + user.Name + ",major='" + user.Major + ",sex='" + user.Sex + ",club='" + user.Club + ",mobile='" + user.Mobile + ",maill='" + user.Maill + ",score='" + user.Score + ",state='" + user.State + " where id='" + user.Id + "";

img

所有字段值后都少了单引号

img


而且题主哪些字段不是字符串类型,值部分不需要单引号

img


有其他问题可以继续交流~

看着没有问题,建议把错误信息贴出来