Type '<typeName>' must be a value type or a type argument constrained to 'Structure' in order to be used with 'Nullable' or nullable modifier '?'

Only value types, including structures, can be declared nullable.

' Valid.
Dim n? As Integer
Dim m As Integer?

' Not valid.
' Dim p? As Object
' Dim q As Nullable(Of Object)

Error ID: BC33101

To correct this error

  • Remove the '?' or Nullable.

  • Use a value data type.

See Also

Concepts

Nullable Value Types