title: Converting binary data to image in C#
body: <p>I was stuck with how to retrieve an image from MySQL database and convert it from Binary format to Bitmap Image to display it in <code>ASP:Image</code> or <code>HTML Image</code>. I am able to upload image but its being converted to Binary data and I couldn't understand how to convert it back to Bitmap format :(</p>
  
  <pre><code>protected void Button2_Click(object sender, EventArgs e)
  {
      cmd = new OdbcCommand("SELECT picture from profile limit 1", MyConnection);
      MyConnection.Open();
      OdbcDataReader dr = cmd.ExecuteReader();
      if (dr.HasRows == false)
      {
          Response.Write("No rows");
      }
      if(dr.Read())
      {
          // WHAT TO CODE HERE?
      }
  }
  </code></pre>
  
  <p>Anybody please help me in fill the code with <strong>WHAT TO CODE HERE</strong> part.</p>