Conversion

Data Type Conversion

Element

Description

CBool function

Converts an expression to a Boolean data type

CByte function

Converts an expression to a Byte data type

CChar function

Converts a string expression to a Char data type

CDate function

Converts an expression to a Date data type

CDbl function

Converts an expression to a Double data type

CDec function

Converts an expression to a Decimal data type

CInt function

Converts an expression to an Integer data type

CLng function

Converts an expression to a Long data type

CObj function

Converts an expression to an Object data type

CSng function

Converts an expression to a Single data type

CStr function

Converts an expression to a String data type

CType function

Converts an expression to any valid data type, structure, object type, or interface

DateValue function

Converts the string representation of a date to a date

DirectCast function

Converts a variable to its runtime type

Option Strict statement

Determines whether narrowing operations are allowed

Str function

Converts a numeric value to a string

TimeValue function

Converts a string representation of time to a Date data type

Val function

Converts a numeric string to a number

ValDec function

Converts a numeric string to a Decimal data type

Other Conversion

Element

Description

ErrorToString method

Returns the descriptive error message corresponding to a particular error code

Fix function

Returns the integer ...

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.