using log4net at the debug level? in some version of hibernate and log4net there is an incompatibility when turn on logging at the debug level. all you get is this error about 'unable to execute sql cannot cast boolean to string'. try turning up your logging level to info and the problem should go away.


ok, found the solution. nothing wrong with mapping etc., just with how the linq query is translated to sql. in particular, how this line is translated:

&& item.isactive == true

somehow, this gets translated into the complex case-statement which ultimately results in the exception message. however, the == true-part isn't really necessary. by removing it, the translator no longer gets confused and provides the proper sql:


no more case-statement and no more exception.

Related Query

More Query from same tag