MySqlCommand Command.Parameters.Add已过时

MySqlCommand Command.Parameters.Add已过时,第1张

MySqlCommand Command.Parameters.Add已过时

尝试

AddWithValue

command.Parameters.AddWithValue("@mcUserName", mcUserNameNew);command.Parameters.AddWithValue("@mcUserPass", mcUserPassNew);command.Parameters.AddWithValue("@twUserName", twUserNameNew);command.Parameters.AddWithValue("@twUserPass", twUserPassNew);

并且不要将占位符用单引号引起来。

string SQL = "INSERT INTO `twMCUserDB` (`mc_userName`, `mc_userPass`, `tw_userName`, `tw_userPass`) VALUES (@mcUserName, @mcUserPass, @twUserName, @twUserPass)";


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4956152.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存