È possibile confrontare l'operando 'Is' del tipo 'typename' solo con 'Nothing' perché 'typename' è un tipo nullable

Una variabile dichiarata come nullable è stata confrontata con un'espressione diversa da Nothing mediante l'operatore Is .

ID errore: BC32127

Per correggere l'errore

  1. Per confrontare un tipo di valore nullable con un'espressione diversa da Nothing usando l'operatore Is, chiamare il metodo GetType sul tipo di valore nullable e confrontare il risultato con l'espressione, come mostrato nell'esempio seguente.
Dim number? As Integer = 5  

If number IsNot Nothing Then  
  If number.GetType() Is Type.GetType("System.Int32") Then

  End If  
End If  

Vedi anche