Check if record is null

  • Thread starter Thread starter Andrew Banks
  • Start date Start date
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
 
Andrew,

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

Ex:

if (myTable.Rows[0][0] == DBNull.Value)
...
 
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
 
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
 
Back
Top