SyntaxDim result As typename = tryCast(expression, typename)
DescriptionNew in 2005. The tryCast function converts an expression or object to the specified type. The original type of expression must have an inheritance relationship with the new type, or an error occurs. Usage at a Glance
Version DifferencesThe TRyCast function is new to Visual Basic 2005. See AlsoCType Function, DirectCast Function |