VB.NET Language in a Nutshell

   
DirectCast Function

Named Arguments

No

Syntax

DirectCast( expression, typename )

expression (required; any)

The data item to be converted

typename (required; Keyword)

The data type, object type, structure, or interface to which expression is to be converted

Return Value

expression cast as a typename interface or object

Description

Converts an expression to its runtime data type, if possible; otherwise , returns an error.

Rules at a Glance

Programming Tips and Gotchas

VB .NET/VB 6 Differences

The DirectCast function is new to VB .NET.

See Also

CType Function

   

Категории