Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SqlNullValueException Class
Collapse the table of content
Expand the table of content

SqlNullValueException Class

The exception that is thrown when the Value property of a System.Data.SqlTypes structure is set to null.

System.Object
  System.Exception
    System.SystemException
      System.Data.SqlTypes.SqlTypeException
        System.Data.SqlTypes.SqlNullValueException

Namespace:  System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)

[SerializableAttribute]
public sealed class SqlNullValueException : SqlTypeException

The SqlNullValueException type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSqlNullValueException()Initializes a new instance of the SqlNullValueException class with a system-supplied message that describes the error.
Public methodSupported by the XNA FrameworkSqlNullValueException(String)Initializes a new instance of the SqlNullValueException class with a specified message that describes the error.
Public methodSupported by the XNA FrameworkSqlNullValueException(String, Exception)Initializes a new instance of the SqlNullValueException class with a specified error message and a reference to the inner exception that is the cause of this exception.
Top

  NameDescription
Public propertyDataGets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public propertyHelpLinkGets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public propertyHResultGets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
Public propertySupported by the XNA FrameworkInnerExceptionGets the Exception instance that caused the current exception. (Inherited from Exception.)
Public propertySupported by the XNA FrameworkMessageGets a message that describes the current exception. (Inherited from Exception.)
Public propertySourceGets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public propertySupported by the XNA FrameworkStackTraceGets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public propertyTargetSiteGets the method that throws the current exception. (Inherited from Exception.)
Top

  NameDescription
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetBaseExceptionWhen overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public methodSupported by the XNA FrameworkGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetObjectDataWhen overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public methodSupported by the XNA FrameworkGetTypeGets the runtime type of the current instance. (Inherited from Exception.)

In XNA Framework 3.0, this member is inherited from Object.GetType().
Public methodSupported by the XNA FrameworkToStringCreates and returns a string representation of the current exception. (Inherited from Exception.)
Top

In order to avoid throwing this exception, you should always examine the IsNull property of the structure before accessing the Value property.

.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

XNA Framework

Supported in: 3.0, 2.0, 1.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft