problems with checking against NULL value in mssql2000 db

Discussion in 'ASP .Net' started by excelleinc.com, Sep 10, 2004.

  1. 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"
    excelleinc.com, Sep 10, 2004
    #1
    1. Advertising

  2. excelleinc.com

    Hermit Dave Guest

    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" <> wrote in message
    news:yhp0d.1123633$...
    > 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"
    >
    >
    Hermit Dave, Sep 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Taras
    Replies:
    2
    Views:
    4,800
    Rick Spiewak
    Oct 5, 2003
  2. Randy
    Replies:
    0
    Views:
    520
    Randy
    Jun 9, 2006
  3. pln

    C# MSSQL2000 update

    pln, Jul 21, 2006, in forum: C Programming
    Replies:
    6
    Views:
    289
    J. J. Farrell
    Jul 21, 2006
  4. Paul
    Replies:
    2
    Views:
    409
  5. Claudiu Popa

    Checking against NULL will be eliminated?

    Claudiu Popa, Mar 2, 2011, in forum: Python
    Replies:
    15
    Views:
    1,866
    Carl Banks
    Mar 4, 2011
Loading...

Share This Page