I am migrating vb6 project to vb.net. there are variant type arrays that I migrated as object types.
having this code line I get the error: Operator '=' is not defined for type 'DBNull' and type 'Integer'
If arrY(13, X) = gloT And (CBool(arrY(18, X)) = True Or (CBool(arrY(18, X)) = False And arr(65, X) = 100)) Then
arr(65, X) has a null value . If I cannt initialize it to 0 how can I avoid the exception?
e.g.
Dim arr(100,100) as Integer
Dim r as integer, c as integer
For r=1 to 100
For c=1 to 100
arr(r,c)=0
Next c
Next r
Alternatively, you could modify the values in the condition:
f arrY(13, X) = gloT And (CBool(arrY(18, X)) = True Or (CBool(arrY(18, X)) = False And (arr(65, X) + 0) = 100)) Then