VB.NET - SQLCommand.ExecScalar() 在返回时抛出未引用的异常?
我正在调用 Sqlcommand.ExecScalar() - 单步执行存储过程工作正常,在
RETURN @RecordNum
@RecordNum 下正确包含一个 bigint,如范围所示。当我进入 RETURN.. 时,我抛出了一个异常,该视觉工作室似乎无法捕获。
直接执行时,存储过程工作正常,并且返回一个值,没有问题,而且看起来一切都很好,从我的代码中单步执行它。
但是一旦我进入“RETURN @RecordNum”(并且 recordnum 包含一个有效的数字..) BOOM!例外! (并且在 Visual Studio 中也没有异常的详细信息。
我归咎于矩阵中的故障..但是有什么建议吗?
我什至已经关闭了将 ExecScalar 的返回分配给任何东西,相同的结果..我已经尝试过 ExecReader(),同样的结果,我打开和关闭了 NO COUNT,同样的结果,如果我还没有秃头,我现在就会秃头了!
I'm calling Sqlcommand.ExecScalar() - stepping through the stored proc works fine, right under
RETURN @RecordNum
@RecordNum correctly contains a bigint, as scoped. When I step into the RETURN.. I get an exception thrown, that visual studio does not seem to be able to capture.
The stored procedure works fine when executed directly, and returns a value without problem, and it seems like all is well, stepping through it from my code.
But as soon as I step into 'RETURN @RecordNum' (and recordnum contains a valid number..) BOOM! EXCEPTION! (and no details in the exception either back in visual studio.
I'm blaming a glitch in the matrix.. but any suggestions out there?
I've turned off even assigned the return from the ExecScalar to anything, same result.. I've tried ExecReader(), same result. I have turned NO COUNT on and off, same result. If I wasn't already bald, I would be now!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其更改为
SELECT @RecordNum
Change it to
SELECT @RecordNum