Export (0) Print
Expand All

Nullable.Value Property

Note: This property is new in the .NET Framework version 2.0.

Gets the value of the current Nullable value.

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

public:
property T Value {
	T get ();
}
/** @property */
public T get_Value ()

public function get Value () : T

Property Value

The value of the current Nullable object if the HasValue property is true. An exception is thrown if the HasValue property is false.

Exception typeCondition

InvalidOperationException

The HasValue property is false.

The following code example returns the value of a Nullable object if that object has a defined value; otherwise, a default value is returned.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft