I have a C # question. I just wanted to ask the community about using System.DBNull in combination with using DataReader.
When querying a database and checking for null values, which is more appropriate / preferred?
Using the operator:
reader["fieldname"] is DBNull
or just check the value:
reader["fieldname"] == DBNull.Value
Both seem to work. I just wanted other opinions.
source share