Check if record is null

A

Andrew Banks

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
 
W

Wes Brown

Andrew,

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

Ex:

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

Andrew Banks

Thanks Wes,

It's appreciated

Wes Brown said:
Andrew,

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

Ex:

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

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
 
R

ruca

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 said:
Andrew,

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

Ex:

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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top