CSV Reports
ChangeType Method



KellermanSoftware.CsvReports Namespace > ConvertLogic Class : ChangeType Method
An Object that implements the IConvertible interface.
The Type to which value is to be converted.
Returns an Object with the specified Type and whose value is equivalent to the specified object.
Syntax
Public Shared Function ChangeType( _
   ByVal value As Object, _
   ByVal conversionType As Type _
) As Object
Dim value As Object
Dim conversionType As Type
Dim value As Object
 
value = ConvertLogic.ChangeType(value, conversionType)
public static object ChangeType( 
   object value,
   Type conversionType
)
public:
static Object^ ChangeType( 
   Object^ value,
   Type^ conversionType
) 

Parameters

value
An Object that implements the IConvertible interface.
conversionType
The Type to which value is to be converted.

Return Value

An object whose Type is conversionType (or conversionType's underlying type if conversionType is Nullable<>) and whose value is equivalent to value. -or- a null reference, if value is a null reference and conversionType is not a value type.
Remarks
This method exists as a workaround to System.Convert.ChangeType(Object, Type) which does not handle nullables as of version 2.0 (2.0.50727.42) of the .NET Framework. The idea is that this method will be deleted once Convert.ChangeType is updated in a future version of the .NET Framework to handle nullable types, so we want this to behave as closely to Convert.ChangeType as possible. This method was written by Peter Johnson at: http://aspalliance.com/author.aspx?uId=1026.
Requirements

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

See Also

Reference

ConvertLogic Class
ConvertLogic Members