title: What is the best way to find out whether image column is null or not?
body: <p><strong>Problem Definition:</strong>
  I have a table in a SQL Server database. This table has an column of type image and it allows null values. I'm going to read this table using <code>SqlDataReader</code> and show the images if they are available. </p>
  
  <p><strong>What I tried first time:</strong> To check whether the image column is null or not I did this</p>
  
  <pre><code>SqlDataReader reader = command.ExecuteReader();  // command is a SqlCommand
  
  while(reader.Read())
  {
      if(reader["Image"] != null)     // Image is a column name of the table
      {
          //Do something
      }
  }
  </code></pre>
  
  <p><strong>The result:</strong> But it never equals to null (I also checked the <code>Equal</code> method). This column never is null even if has not data inserted (In SQL Server I can see it is actually null)</p>
  
  <p><strong>What I tried second time:</strong> So I tried this code and its working but I wonder why it doesn't return null. </p>
  
  <pre><code>SqlDataReader reader = command.ExecuteReader();  // command is a SqlCommand
  
  while(reader.Read())
  {
      if(reader["Image"].GetType() != typeof(System.DBNull)) 
      {
          //Do something
      }
  }
  </code></pre>
  
  <p><strong>Question:</strong> Any idea to explain this behavior? I will be pleased if there is a better way to find out whether the columns of type Image in SQL Server Tables are null or not.</p>