title: How to check datareader and compare it with another value?
body: <p>I want to check my data reader value and compare it with another value I use this peace of code but it does not work.                                     </p>
  
  <pre><code>ol_com.CommandText = "select [card_id] from student_info where [card_id] = '" + card_No.Text + "'";
  reader = ol_com.ExecuteReader();
  if (reader.IsDBNull(0) &amp;&amp; reader["card_id"] == "-")
  {
     //do my work here
  }//end if
  
  else
  {
      //give a message
  }//end else
  </code></pre>