O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

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

Name

IsDBNull Function

Class

Microsoft.VisualBasic.Information

Syntax

IsDBNull(expression)
expression (required; any expression)

Return Value

Boolean

Description

Determines whether expression evaluates to DbNull (that is, is equal to System.DbNull.Value).

Rules at a Glance

  • DbNull is not the same as Nothing or an empty string. DbNull is used to denote the fact that a variable contains a missing or nonexistent value, and it is used primarily in the context of database field values.

  • Since any expression that contains DbNull evaluates to DbNull, an expression such as:

    If var = DbNull Then

    will always fail. The only way to test for a DbNull value is to use IsDbNull.

VB.NET/VB 6 Differences

The IsDBNull function is new to VB.NET.

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