Visual Basic (Usage) | ![]() |
---|---|
Dim source As Object Dim targetType As BuiltInType Dim value As Object value = TypeInfo.Cast(source, targetType) |
C# | |
---|---|
public static object Cast( object source, BuiltInType targetType ) |
Parameters
- source
- The instance of a source value.
- targetType
- Type of the target.
Return Value
Return casted value.System.DBNullException | Description |
---|---|
System.InvalidCastException | if imposible to cast. |
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x