0
Reply

How do I test for Null values when using datareader ?

Mark

Mark

Jul 7 2009 1:46 PM
3.3k
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 ?