开发者

SqlDataReader GetBoolean from Calculated Resultset Field

开发者 https://www.devze.com 2023-01-02 06:08 出处:网络
I\'ve got a field in my SQL SPROC resultset that is a calculated CASE statement that returns 1 or 0 (ie True/False).

I've got a field in my SQL SPROC resultset that is a calculated CASE statement that returns 1 or 0 (ie True/False).

When I try to use the GetBoolean method of the SqlDataReader class and exception gets th开发者_开发百科rown.

Any suggestions would be appreciated.


Cast the value into a bit before returning it

CAST (value AS bit)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号