Check if record is null

Discussion in 'ASP .Net' started by Andrew Banks, Feb 25, 2004.

  1. Andrew Banks

    Andrew Banks Guest

    I'm outputting data from a SQL server database to a web form (C#).

    How can I detect if a value is null in the database?

    Thanks
    Andrew Banks, Feb 25, 2004
    #1
    1. Advertising

  2. Andrew Banks

    Wes Brown Guest

    Andrew,

    To check if a value is null compare to DBNull.Value.

    Ex:

    if (myTable.Rows[0][0] == DBNull.Value)
    ...

    On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
    <> wrote:

    > I'm outputting data from a SQL server database to a web form (C#).
    >
    > How can I detect if a value is null in the database?
    >
    > Thanks
    >
    >
    Wes Brown, Feb 25, 2004
    #2
    1. Advertising

  3. Andrew Banks

    Andrew Banks Guest

    Thanks Wes,

    It's appreciated

    "Wes Brown" <> wrote in message
    news:eek:...
    > Andrew,
    >
    > To check if a value is null compare to DBNull.Value.
    >
    > Ex:
    >
    > if (myTable.Rows[0][0] == DBNull.Value)
    > ...
    >
    > On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
    > <> wrote:
    >
    > > I'm outputting data from a SQL server database to a web form (C#).
    > >
    > > How can I detect if a value is null in the database?
    > >
    > > Thanks
    > >
    > >

    >
    Andrew Banks, Feb 25, 2004
    #3
  4. Andrew Banks

    ruca Guest

    In vb, how can I do the same. I mean.... to see if a DataSet it is empty?


    --

    Thank's (if you try to help me)
    Hope this help you (if I try to help you)
    ruca

    "Wes Brown" <> escreveu na mensagem
    news:eek:...
    > Andrew,
    >
    > To check if a value is null compare to DBNull.Value.
    >
    > Ex:
    >
    > if (myTable.Rows[0][0] == DBNull.Value)
    > ...
    >
    > On Wed, 25 Feb 2004 18:41:34 GMT, Andrew Banks
    > <> wrote:
    >
    > > I'm outputting data from a SQL server database to a web form (C#).
    > >
    > > How can I detect if a value is null in the database?
    > >
    > > Thanks
    > >
    > >

    >
    ruca, Feb 26, 2004
    #4
    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. =?Utf-8?B?SnVzdGlu?=

    Retrieving Record Key while creating the record.

    =?Utf-8?B?SnVzdGlu?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    623
    =?Utf-8?B?SnVzdGlu?=
    Oct 5, 2004
  2. Replies:
    5
    Views:
    26,519
    Mike Schilling
    Mar 29, 2006
  3. André
    Replies:
    0
    Views:
    3,730
    André
    Jun 25, 2006
  4. G Fernandes
    Replies:
    9
    Views:
    577
    DHOLLINGSWORTH2
    Feb 27, 2005
  5. Mike
    Replies:
    12
    Views:
    703
    Daniel Pitts
    Sep 26, 2008
Loading...

Share This Page