Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Information.VbTypeName Method

Returns a String value containing the Visual Basic data type name of a variable.

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public static string VbTypeName(
	string UrtName
)

Parameters

UrtName
Type: System.String
Required. String variable containing a type name used by the common language runtime.

Return Value

Type: System.String
Returns a String value containing the Visual Basic data type name of a variable.

VbTypeName returns the Visual Basic type name corresponding to the common language runtime type name. For example, if UrtName contains "Int32" or "System.Int32", VbTypeName returns "Integer". If VbTypeName does not recognize the value of UrtName, it returns Nothing (not the string "Nothing").

The type name in UrtName can be obtained from various sources, for example from the Name property in the MemberInfo array of the Type class.

The following example uses the VbTypeName function to return data type names for several variables.


Dim sysDateName As String = "System.DateTime"
Dim sysShortName As String = "Int16"
Dim sysBadName As String = "Nonsense"
Dim testVbName As String
testVbName = VbTypeName(sysDateName)
' Returns "Date".
testVbName = VbTypeName(sysShortName)
' Returns "Short".
testVbName = VbTypeName(sysBadName)
' Returns Nothing.


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft