By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,387 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,387 IT Pros & Developers. It's quick & easy.

problems with checking against NULL value in mssql2000 db

P: n/a
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
--
Vlado Jasovic
Excelle Technologies Inc.
http://www.excelleinc.com
"single source for all your computer needs"
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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)
"excelleinc.com" <vj******@excelleinc.com> wrote in message
news:yh*********************@news.easynews.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
--
Vlado Jasovic
Excelle Technologies Inc.
http://www.excelleinc.com
"single source for all your computer needs"

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.