O'Reilly logo

Visual Basic 2010 Unleashed by Alessandro Del Sole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing Nullable Types

As we mentioned talking about value types and reference types, value types have a default value that is typically zero whereas reference types have a default value that is Nothing. This is because a reference type can store null values, whereas value types cannot. Attempting to assign a null value to a value type would result in resetting to the default value for that type. This is a limitation, because there are situations in which you need to also store null values in value types, for example when fetching data from a SQL Server database. You can have a hypothetical Orders table where the Ship date column enables null values. SQL Server has its own data types, and one of these is the DBNull that enables null values. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required