DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Null Value

  1. #1
    Eric Lindros Guest

    Null Value

    How do you test for a Null value in a returned recordset from SQL Server 7?

    I have tried the following, with no luck:

    If (rs("ExtPrice1") = NULL) Then
    'some code that never gets executed
    End If

    What is the proper way to do this?

    I have also tried all of the following:

    If (rs("ExtPrice1") = "NULL") Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = null) Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = "null") Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = Nothing) Then
    'some code that never gets executed
    End If

    If (rs("ExtPrice1") = "") Then
    'some code that never gets executed
    End If



  2. #2
    Sudha xxxxxxx Guest

    Re: Null Value


    Try this
    If IsNull(rs("ExtPrice1")) then
    'Some code
    End If

    "Eric Lindros" <nobody@nobody.com> wrote:
    >How do you test for a Null value in a returned recordset from SQL Server

    7?
    >
    >I have tried the following, with no luck:
    >
    >If (rs("ExtPrice1") = NULL) Then
    > 'some code that never gets executed
    >End If
    >
    >What is the proper way to do this?
    >
    >I have also tried all of the following:
    >
    >If (rs("ExtPrice1") = "NULL") Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = null) Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = "null") Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = Nothing) Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = "") Then
    > 'some code that never gets executed
    >End If
    >
    >



  3. #3
    Sudha xxxx Guest

    Re: Null Value


    Try this
    If IsNull(rs("ExtPrice1")) then
    'Some code
    End If

    "Eric Lindros" <nobody@nobody.com> wrote:
    >How do you test for a Null value in a returned recordset from SQL Server

    7?
    >
    >I have tried the following, with no luck:
    >
    >If (rs("ExtPrice1") = NULL) Then
    > 'some code that never gets executed
    >End If
    >
    >What is the proper way to do this?
    >
    >I have also tried all of the following:
    >
    >If (rs("ExtPrice1") = "NULL") Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = null) Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = "null") Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = Nothing) Then
    > 'some code that never gets executed
    >End If
    >
    >If (rs("ExtPrice1") = "") Then
    > 'some code that never gets executed
    >End If
    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links