Null Value


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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
    >
    >



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center