my tweets
- @clickflickca what's with the at&t phone? out of town visitor? 22 mins ago
- @precid no problem man! 24 mins ago
- Watching @Notez make an amazing dinner!! 60 mins ago
- @kitschkreative yeah I checked the site out, some amazing bikes and related tech!! Good stuff 1 hour ago
- @kitschkreative ahhahah I'll be on the lakeshore in 15! 2 hours ago
-
RSS Links
Archives
Blogroll
subsonic won’t update my bit field?
I recently ran into a really strange problem while using SubSonic. I had a bit column in my database that was set to not allow nulls and had a default value of false. Pretty standard stuff in the world of database design I guess.
When it came time to start saving my entities to the database, everything was working ok, except…. except after I had created a record in the database I could never change the IsActive column, like wtf? I could never toggle between true and false on an existing record, but an insert would save the record perfectly every time.
To make a long incredibly frustrating story short, it turns out that if you have a bit field, that is set to allow nulls and has a default value of false it will never update (this is only using SubSonic).
So to ensure your bit fields work correctly in SubSonic, make sure those bit columns allow null and don’t have any default values!