title: How to Handle the Hashtable null value?
body: <p>I have a problem while checking a hashtable value. In the code below I am storing 60 values in the hashtable "hash". One of the values is (or can be) Null. I am checking each entry against its corresponding entry in hashtable "hash1", to see if they match each other. If they don't match I want to check if the value in "hash" is Null, but I can't catch it - it's falling through the 'else' part). How can I overcome this problem?</p>
  
  <pre><code>if (hash[j].ToString() == "")
  {
      NotAnswerQuestionCount++;
  }
  </code></pre>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>int ctAnsCount=0, flAnsCount=0,NotAnswerQuestionCount=0;
  SqlDataAdapter sda = 
      new SqlDataAdapter("select quesno,[Key] from Answerkey" ,con);
  DataSet ds = new DataSet();
  sda.Fill(ds);
  
  Hashtable hash = new Hashtable();
  
  for (int i = 0; i &lt; 60; i++)
  {
      hash[i+1] = ResultsListBox.Items[i].ToString();
  }
  
  Hashtable hash1 = new Hashtable();
  
  for (int i = 0; i &lt; 60; i++)
  {
      hash1[i+1] = ds.Tables[0].Rows[i][1].ToString();
  }
  
  for (int j = 1; j &lt;=60; j++)
  {
      if (hash[j].ToString() != hash1[j].ToString())
      {
          if (hash[j].ToString() == "")
          {
              NotAnswerQuestionCount++;
          }
          //else
  
  
          flAnsCount++;
      }
      else
      {           
          ctAnsCount++;    
      }
  }
  </code></pre>