NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DBNull.ToType

Calls the appropriate method, depending on the specified type.

[Visual Basic]
Overridable Public Function ToType( _
   ByVal type As Type _
) As Object
[C#]
public virtual object ToType(
   Type type
);
[C++]
public: virtual Object* ToType(
   Type* type
);
[JScript]
public function ToType(
   type : Type
) : Object;

Parameters

type
The Type to DBNull into.

Return Value

None, but the return value is typed the same as type.

Exceptions

Exception Type Condition
InvalidCastException (Always thrown.)

Remarks

The following table specifies the method called based on the Type of the type parameter.

Method called Type

of

ToBoolean bool
ToChar char
ToSByte sbyte
ToByte byte
ToInt16 short
ToUInt16 ushort
ToInt32 int
ToUInt32 uint
ToInt64 long
ToUInt64 ulong
ToSingle float
ToDouble Double
ToDecimal Decimal
ToDateTime DateTime

See Also

DBNull Class | DBNull Members | System Namespace | Type