https://msdn.microsoft.com/en-us/library/cc716729(v=vs.110).aspx

On Mon, Mar 7, 2016 at 1:56 PM, Steve Lyle <[email protected]> wrote:

> In SQL (2012) I defined a column as binary(1).
> In the mapping file this doesn't naively convert to a type I can
> understand given the documentation.
> In the c# class I defined this attribute as a bool.
> But at run time I get the error:
>      An exception of type 'NHibernate.ADOException' occurred in
> NHibernate.dll but was not handled in user code
>      Additional information: Could not cast the value in field col_5_0_ of
> type Byte[] to the Type BooleanType.
>      Please check to make sure that the mapping is correct and that your
> DataProvider supports this Data Type.
>
> What type attribute of the mapping for this property applies to a
> bool/binary?  Please provide specific syntax.
> Or should I redefine the database table attribute to some other type?
> How do you suggest as a best practice of handling a (T/F) field in a db
> and through nHibernate?
>
> <property type="typename" />
> type (optional): a name that indicates the NHibernate type.
> typename could be:  The name of a NHibernate basic type (eg. Int32,
> String, Char, DateTime, Timestamp, Single, Byte[], Object, ...).
>
>
> Thanks for the tips.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to