Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Boolean datatype inserts NULL value when I set the default value to 0 (or False) View modes: 
User avatar
Member
Member
cnguyen-sequenom - 10/13/2010 2:23:04 PM
   
Boolean datatype inserts NULL value when I set the default value to 0 (or False)
I created a custom table with a non-nullable BIT field with a default value of 0 (or False).

When I do an insert through the CMS, it throws an exception saying that it does not accept NULL values, but I was wondering why it doesn't insert the default value for me?

Curious as to seeing other behaviors, I then changed the field to nullable and when I did an insert again, it inserted a NULL value, not my default value.

Can someone please explain to me if this is expected? How can I insert a bit field with the default value?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 10/27/2010 4:02:45 PM
   
RE:Boolean datatype inserts NULL value when I set the default value to 0 (or False)
Hello,

Firstly, what version of Kentico CMS do you use? Do you have applied any hotfix?

I tested that in version 5.5.23 and 5.0.0 and it works fine with default value set to false.

Could you please provide us with detailed description of your custom table bit field?

Also please let us know exact error message. Thanks in advance. Some screenshots would be greatly appreciated.

Furthermore, do you have any related customizations?

Best regards
Ondrej Vasil