J
jkeel
Dim _x as string
I get an error when I do the following and can't figure out why.
reader.GetValue("X") is a null value in the database.
_x =
IIF(reader.isDBNull(reader.GetOrdinal("X")),"",reader.GetValue("X"))
although if I do this I receive no error (which makes perfect sense)
_x = IIF(reader.isDBNull(reader.GetOrdinal("X")),"","")
It looks as though in the first example it is bombing out because the
false part of the IIF statement, reader.GetValue("X") is null. Why is
it even evaluating that part of the statement? It should only be
evaluating the true part which is returning an empty string.
Any help would be greatly appreciated.
Jason
I get an error when I do the following and can't figure out why.
reader.GetValue("X") is a null value in the database.
_x =
IIF(reader.isDBNull(reader.GetOrdinal("X")),"",reader.GetValue("X"))
although if I do this I receive no error (which makes perfect sense)
_x = IIF(reader.isDBNull(reader.GetOrdinal("X")),"","")
It looks as though in the first example it is bombing out because the
false part of the IIF statement, reader.GetValue("X") is null. Why is
it even evaluating that part of the statement? It should only be
evaluating the true part which is returning an empty string.
Any help would be greatly appreciated.
Jason