一个简单问题,却没解决!

pzcm2008 2008-12-30 02:24:30
我用的ASP.NET C#
今天调试程序,报错为:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MySqlSecond')' at line 1

这个是说我的数据库语句有错了!
我单步调,把数据库语句拿出来为:
Update GroupInfo set MatchVolume = 'D:\\' where Groupid = (select Groupid from `Group` where GroupName = 'MySqlSecond')
到MySql命令行和MySqlFront下去运行却均正常!
我完全不知道在 ASP.NET下,为什么报错,而且说错误在最后的 “MySqlSecond')”!完全看不出来哪儿有错!难道和C#的其他什么想冲突了?
...全文
80 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
pzcm2008 2008-12-31
  • 打赏
  • 举报
回复
问题已经解决,不是楼上的朋友们所说的问题!
但是感谢支持了!
nihaimeiyoudenglu 2008-12-30
  • 打赏
  • 举报
回复
Update GroupInfo set MatchVolume = 'D:\\' where Groupid = (select Groupid from Group where GroupName = 'MySqlSecond')

在mssql是 用 in
Update GroupInfo set MatchVolume = 'D:\\' where Groupid in (select Groupid from Group where GroupName = 'MySqlSecond')

mysql我不知道是不是

nihaimeiyoudenglu 2008-12-30
  • 打赏
  • 举报
回复
Update GroupInfo set MatchVolume = 'D:\\' where Groupid = (select Groupid from Group where GroupName = 'MySqlSecond')

from 后面的table不要加''
取义 2008-12-30
  • 打赏
  • 举报
回复
为什么回了没有显示呢?

111,131

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧