string sql = "UPDATE" + sqlname + "set PassWord = '"+password+ "'WHERE Id ='"+ id+"'";//报错
//check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATEuserset PassWord = '4'WHERE Id ='9'' at line 1” 问题解决办法
解决
string sql = string.Format("update " + sqlname + " set PassWord ='" + password + "' where userName = " + name);