Mark

Mark

  • NA
  • 1
  • 0

How do I test for Null values when using datareader ?

Jul 7 2009 1:46 PM
I am using a datareader to retreive a data record. As I pull each field in I am trying to test for null values like this: txtProduct.Text = iif(dr.isDBNull(1) = False, dr.getstring(1), "") Why won't this work ? I thought an IIF statement would cause it to skip the code that trys to use the datareader (dr)... ??? Is their another easy one line code fix to test for nulls ?