TypeConverter.GetConvertToException Method

Returns an exception to throw when a conversion cannot be performed.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

protected Exception GetConvertToException(
	Object value,
	Type destinationType
)

Parameters

value
Type: System.Object

The Object to convert, or null if the object is not available.

destinationType
Type: System.Type

A Type that represents the type the conversion was trying to convert to.

Return Value

Type: System.Exception
An Exception that represents the exception to throw when a conversion cannot be performed.

ExceptionCondition
NotSupportedException

Automatically thrown by this method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft