dbnull

Discussion in 'ASP .Net' started by segue, Jan 28, 2008.

  1. segue

    segue Guest

    How would I run an if statement for dbnull?

    Much thanks.

    Dim reader As OdbcDataReader = select_command.ExecuteReader()
    Do While (reader.Read())

    If reader.Item("somedbfield") <> DBNull.Value Then
    segue, Jan 28, 2008
    #1
    1. Advertising

  2. Hi there,

    Yep, as well as:
    If Not TypeOf reader("somedbfield") Is DbNull then
    If Not reader.IsDbNull(reader.GetOrdinal("somedbfield")) then
    --
    Milosz


    "segue" wrote:

    >
    > How would I run an if statement for dbnull?
    >
    > Much thanks.
    >
    > Dim reader As OdbcDataReader = select_command.ExecuteReader()
    > Do While (reader.Read())
    >
    > If reader.Item("somedbfield") <> DBNull.Value Then
    >
    >
    Milosz Skalecki [MCAD], Jan 29, 2008
    #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. Ravikanth[MVP]
    Replies:
    6
    Views:
    3,870
    Aemca
    Jul 18, 2003
  2. Boris Zakharin

    Adding a DBNull value to the database

    Boris Zakharin, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    Boris Zakharin
    Aug 27, 2003
  3. dave
    Replies:
    1
    Views:
    2,841
    Teemu Keiski
    Nov 26, 2003
  4. Elmo Watson
    Replies:
    3
    Views:
    6,024
    Scott M.
    Dec 25, 2003
  5. Martin
    Replies:
    2
    Views:
    426
    Martin
    Feb 2, 2004
Loading...

Share This Page