title: c# handle null byte array from mysql query
body: <p>i have created an app that basically looks for blob records on a mysql server problem i have is that if for whatever reason the blob field is empty the app crashes. I thought on something like</p>
  
  <p>i currently have</p>
  
  <pre><code>byte[] data = (byte[])DbReader[2];
  </code></pre>
  
  <p>but i was wondering if there is any way to do something like</p>
  
  <pre><code>if (DbReader.IsDbNull(2)
      byte[] data = /* DEFAULT VALUE */
  else
      byte[] data = (byte[])DbReader[2];
  </code></pre>
  
  <p>but can i set a default value?? everything ive tried fails :(</p>