• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Logical Values

Given the title of this chapter, you might be surprised to find logical values included. After all, what could be simpler than a value that's either True or False? Lots of things. Notice that the heading for this section is Logical Values not Boolean Values. A Boolean value can only be one of two values, True or False. (By the way, Boolean is always capitalized because the values are named after the great nineteenth-century mathematician and logician George Boole.) But most applications model something in the real world, and in the real world most logical values can be one of three values: True, False, or Haven't-a-clue. (Okay, call it “Undetermined.”)

Both database theory and the .NET Framework provide direct support for two-state Boolean values. Three-state values are trickier. You can't use a Boolean, which is two-state by definition, if you need to capture that Unknown value. (Allowing Nulls won't work here. You can't allow Null values in a Boolean field.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint