my tweets
- The State of NuGet http://t.co/IjWa7LXZ 48 mins ago
- Pears http://t.co/nBiT7GF6 4 hours ago
- were going to be taking questions during our #devto presentation on monday, tweet them to #askdevto ! 4 hours ago
- band on the run 4 hours ago
- redoing http://t.co/mjRXEwUA 4 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!