Chapter 19. Nullable Value Types
In this chapter:
C#’s Support for Nullable Value Types
The CLR Has Special Support for Nullable Value Types
As you know, a variable of a value type can never be
null; it always contains the value type’s value
itself. In fact, this is why they call these types
value types. Unfortunately, there are some
scenarios in which this is a problem. For example, when designing a
database, it’s possible to define a column’s data type to be a 32-bit
integer that would map to the Int32 data type of the Framework Class Library (FCL). But a column in a database can indicate that the value is nullable. That is, it is OK to have no value in the row’s column. Working with database data by using the Microsoft ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access