, ...
, BIT. , "" - "" ... BIT.
SQL- #, case, :
case when foo = faa then 1 else 0 end as outcome
and when the results were sent to the linq query, the resulting type was changed to INT32. So this failed:
outcome = s.Field<bool>("outcome")
I wanted the result to be allowed for BIT, so I used:
cast(case when foo = faa then 1 else 0 end as bit) as outcome
The point, while TSQL may assume that it is BIT, ADO did not do instead.
All in all, I think I'm saying, don't rely on a framework (.NET or TSQL) to do the dirty work ... If you want BIT, drop it as BIT :)
source
share