Access中关键字in的参数问题
2008-12-08 20:38
183 查看
最近做的项目中需要在SQL语句中使用in,类似于下面的语句
select * from from List where Year=@Year and Month=@Month and MemberId in (@MemberId) order by Count
参数设置如下:
OleDbParameter[] cmdparas = { new OleDbParameter("@Year", year), new OleDbParameter("@Month", month), new OleDbParameter("@MemberId", mId)}
在运行的时候会提示SQL语句错误
后来改为,即下划线部分有变化,去掉了括号。
select * from from List where Year=@Year and Month=@Month and MemberId in @MemberId order by Count
这样依然不行,有没有哪位高手能指点一下,这个地方究竟该怎么改
select * from from List where Year=@Year and Month=@Month and MemberId in (@MemberId) order by Count
参数设置如下:
OleDbParameter[] cmdparas = { new OleDbParameter("@Year", year), new OleDbParameter("@Month", month), new OleDbParameter("@MemberId", mId)}
在运行的时候会提示SQL语句错误
后来改为,即下划线部分有变化,去掉了括号。
select * from from List where Year=@Year and Month=@Month and MemberId in @MemberId order by Count
这样依然不行,有没有哪位高手能指点一下,这个地方究竟该怎么改
相关文章推荐
- iOS常见问题之 The 'Apple Developer Program License Agreement' has been updated. In order to access certai
- DISCUZ在win2003环境下 Unable to access ./include/common.inc.php in... 的问题终极解决方案
- tomcat请求参数问题解决: Invalid character found in the request target. The valid characters are defined in
- 存储过程IN参数疑难问题解决方法
- Access关键字问题
- xcode编译器问题——参数类型识别错误,EXC_BAD_ACCESS
- 使用JDBC遇到SQL关键字in的问题
- ADO.NET来操作Access的sql参数赋值问题(转载)
- 解决在IDEA14 的Maven下 出现 Cannot access in offline mode 问题
- 润乾报表索引中丢失 IN 或 OUT 参数问题
- 关于oracle存储过程调用问题。execute method error : DataAccessException,或者时参数个数或类型错误,等等
- DISCUZ在win2003环境下 Unable to access ./include/common.inc.php in... 的问题终极解决方案
- mysql传递参数关键字的out in inout 的区别
- 存储过程使用逗号分隔作为IN参数疑难问题解决方法【真正解决】
- C# ACCESS 查询提示“至少一个参数没有被指定”问题
- sql server 存储过程中输入参数需要用in而失效的问题解决方案
- jdbc查询语句中in后传参数问题的解决方案
- mysql/sqlserver where in 传参数的问题
- 关于oracle in后的参数个数超过1000问题
- 解决VC 类向导添加变量后莫名其妙出现 Unhandled exception in xxx.exe:0xC0000005:Access Violation错误的问题