Are you testing for a character with a scalar value of zero, or a null value
in a database column? If you want to test the value of characters, use the
string.Chars property. If you want to test if a column has a null value,
check if the value has a type of DBNull. If you're using a data reader, use
the IsDBNull method:
if(reader.Read())
{
int n = reader.IsDBNull(0)? 0: reader.GetInt32(0);
...
}