Hi,
I have an SQL Query that loads a SQLDataReader object.
The returned record has bit datatype columns that I use to provide
true/false values.
I can't get a definite answer googling on how to test if this field is null.
I get casting errors, and can't check for null on a null data value errors
messages.
can someone point me to a definite article on checking for nulls using an
SQLDataReader
or
the code (C#) on testing for null value?
thanks
Chris
Mark White - 30 Sep 2005 17:23 GMT
Check it against System.DBNull.Value. That will give the desired results.
> Hi,
>
[quoted text clipped - 18 lines]
>
> Chris
Ron - 30 Sep 2005 18:37 GMT
Your instance of SqlDataReader has a function for that purpose: IsDBNull.
> Hi,
>
[quoted text clipped - 18 lines]
>
> Chris