problems with checking against NULL value in mssql2000 db

E

excelleinc.com

Hi,

I'm trying to check if field contains NULL value in MSSQl 2000 database but
keep receiving error.

asp.net code:

If Trim(HLSQLDSet.Tables("mfglinks").Rows(15).Item(0)) Is Null Then
URLSurgeS.Visible = "False"
End If

error:
BC30822: 'Null' is not declared. 'Null' constant is no longer supported; use
'System.DBNull' instead

I'm getting error when I use System.DBNull instead of Null.


Thanks
 
H

Hermit Dave

when comparing to a datacolumn in a dataset /datatable use
System.DbNull.value

ie something like
If Trim(HLSQLDSet.Tables("mfglinks").Rows(15).Item(0)) = System.DbNull.Value
Then
URLSurgeS.Visible = "False"
End If


--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top