Throws an InvalidCastException. Called by the ToType method.
[Visual Basic] Overridable Public Function ToDateTime() As DateTime [C#] public virtual DateTime ToDateTime(); [C++] public: virtual DateTime ToDateTime(); [JScript] public function ToDateTime() : DateTime;
None, but the return value is typed DateTime to implement the IConvertible interface.
Exception Type | Condition |
---|---|
InvalidCastException | (Always thrown.) |
If the ToType type is a DateTime this method is called. This method throws an InvalidCastException().
DBNull Class | DBNull Members | System Namespace | ToType | IConvertible | Type | DateTime