checking for a null value in a data reader

  • Thread starter Thread starter ]-[aTc]-[
  • Start date Start date
A

]-[aTc]-[

Hello
I have the following code...
string chkString = " " + dr.GetString(37) + " ";

and I get an error message of ...

Data is Null. This method or property cannot be called on Null values.

How do i check for this null value.

I've tried many things like this..

if (dr.GetValue(37) != null)

{ code}

but does not work

Please help

Thank you

--Mike
 
Back
Top