Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Check if record is null

Reply
Thread Tools

Check if record is null

 
 
Andrew Banks
Guest
Posts: n/a
 
      02-25-2004
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


 
Reply With Quote
 
 
 
 
Wes Brown
Guest
Posts: n/a
 
      02-25-2004
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
>
>


 
Reply With Quote
 
 
 
 
Andrew Banks
Guest
Posts: n/a
 
      02-25-2004
Thanks Wes,

It's appreciated

"Wes Brown" <> wrote in message
news...
> 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
> >
> >

>



 
Reply With Quote
 
ruca
Guest
Posts: n/a
 
      02-26-2004
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...
> 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
> >
> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To check or not to check for NULL? Mike Java 12 09-26-2008 10:46 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
is (!ptr) or (ptr) valid way to check for NULL or NOT NULL? G Fernandes C Programming 9 02-27-2005 03:07 AM
Retrieving Record Key while creating the record. =?Utf-8?B?SnVzdGlu?= ASP .Net 4 10-05-2004 08:11 PM
" Invalid Disk Table in Boot Record - Boot Record could not be repaired " reply@newsgroup.please Computer Support 2 12-01-2003 05:37 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57