how to detect if column in IDataReader has a NULL value?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

..net 2.0

IDataReader reader;
if (reader["field1"] == null)
{
}

This if test don't come true. I've just tested it with a NULL value in
field1, and the code block within the if statement wasn't executed. Instead
it executed the else block (not shown here.)

any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top