OleDB returning DBNull for certain cells

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi,

I'm using OleDBConnection to read data from
Excel. I'm able to read everything except when a cell has
numeric value and the column has alphanumeric data. I get
DBNull when it encounters a numeric value. I'm sure many
people have seen this. Does anyone know how to address
this issue?

Thanks,
Paul
 
Hello,

You can use the IIF statement, although with some
object hierarchies each statement can get pretty long.

There is also a KB article explaining how to modify a
Dataset's XML to supply a default value when a DBNull is
encountered. The article ID is : 318039
Fair warning, though, I followed the instructions
exactly and I do not get the reported results, so if you
can use the KB solution and get it working, let me know.

mklapp
 
Back
Top