cmd.ExecuteScalar 出错~~ 帮忙

ablakare 2012-04-27 07:57:36
cmd.CommandText = "select count(*) from Useres where Name=='" & Me.UTextBox.Text & "'"
con.Open()
Dim i As Integer = cmd.ExecuteScalar

这里出错~~ 不知道什么原因,请高手帮忙~~ 错误提示是("="附件有错误~)~~~~~~
...全文
82 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ablakare 2012-04-27
  • 打赏
  • 举报
回复
哦,, 谢谢各位高手,解决了 就是那个“==”的问题,
happytonice 2012-04-27
  • 打赏
  • 举报
回复
cmd.CommandText = "select count(*) from Useres where Name=='" & Me.UTextBox.Text & "'"
红色的地方错误,用下面的
cmd.CommandText = "select count(*) from Useres where Name='" & Me.UTextBox.Text & "'"
threenewbee 2012-04-27
  • 打赏
  • 举报
回复
sql使用=,不是==,那个是C#写法。
threenewbee 2012-04-27
  • 打赏
  • 举报
回复
==
=>
=

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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