Nullable Booleans – Very interesting…

As I started looking at LINQ, I’m running into some interesting scenarios regarding nullable boolean values. We all know how SQL allows for a BIT to be 3 values: True, False or NULL. We also know that in SQL, handling NULLs in comparisons requires special attention. For the most part NULL does not equal NULL.

The use of LINQ brings this concept and scenario up into the .NET programming world. Now I need to be careful about conditionals that include Nullable(Of Boolean).

I won’t repeat all the information here, but please read the following articles that explain this in good detail:

Nullable Types

Using Nullable Types (C# Programming Guide)

SQL-CLR Type Mismatches (LINQ to SQL)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: