title: Using column name when using SqlDataReader.IsDBNull
body: <p>I have got this code which reads data from SQL DB.</p>
  <p>I don't know how should I edit it so I can use original column name and not column index.</p>
  <pre><code>string query = &quot;SELECT * FROM zajezd WHERE event='&quot; + thisrow+ &quot;' AND year='&quot; + klientClass.Year() + &quot;'&quot;;
  SqlCommand cmd= new SqlCommand(query, spojeni);
  spojeni.Open();
  SqlDataReader read= cmd.ExecuteReader();
              
  
  if (read.Read())
  {
      maskedTextBox2.Text = read.IsDBNull(24) ? 
          string.Empty : 
          read.GetDateTime(24).ToString(&quot;MM/dd/yyyy&quot;);
  </code></pre>