以下语句如何实现?

pandom 2003-09-29 08:06:09
Session("B")=3
sqlcommand.commandtext="select * from tabel1 where A>+session("B")+"
或Session("B")=3
sqlcommand.commandtext="select * from tabel1 where A>"+session("B")+""
其中A列为int类型

但编译器报错(有语法错误),将+改为&亦一样,麻烦告知应如何实现?
...全文
83 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xixigongzhu 2003-09-30
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A>" & Convert.ToString(session("B"))
banni2003 2003-09-30
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A>'"& session("B") &"'"
southdoor 2003-09-30
  • 打赏
  • 举报
回复
当你不知道是哪出错的时候,你最后将语句分开写:
dim m as int32
m=Cint(session("B"))
sqlcommand.commandtext="select * from tabel1 where A>" & m
在第二句看m的值是否是你想要的。
xhan2000 2003-09-30
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A>"+session("B").ToString+""
NoReady 2003-09-30
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A>" & cint(session("B"))
eileendl 2003-09-29
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A>" & CStr(Session("B"))
Alanwn 2003-09-29
  • 打赏
  • 举报
回复
sqlcommand.commandtext="select * from tabel1 where A> session("B")"
sqlcommand.commandtext="select * from tabel1 where A>"session("B")""

16,549

社区成员

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

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