Is vs is not

  • Thread starter Thread starter Thomas Scheiderich
  • Start date Start date
T

Thomas Scheiderich

I have the following code:
****************************************************
while (objDataReader.Read() = true)
if(objDataReader(0) is System.DBNull.value) then
else
response.Write("In While loop return from sp_textcopy - " &
objDataReader(0) + "<br>")
end if
end while
***************************************************************************

This works fine, but if I change the line:

if(objDataReader(0) is System.DBNull.value) then

to

if(objDataReader(0) is not System.DBNull.value) then

I get the following error:
****************************************************************************

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30487: Operator 'Not' is not defined for type
'System.DBNull'.

Source Error:

Line 42:
Line 43: while (objDataReader.Read() = true)
Line 44: if(objDataReader(0) is not System.DBNull.value) then
Line 45: else
Line 46: response.Write("In While loop return from sp_textcopy - " &
objDataReader(0) + "<br>")

Source File: C:\Inetpub\wwwroot\Contour\TMP8etkl17wvr.aspx Line: 44
****************************************************************************
*****

If I can use "is", can't I also use "is not"? If not, how would I phrase it
correcty?

Thanks,

Tom.
 
Back
Top