title: Converting BLOB Data Into base64 and Then Display it
body: <p>I am trying to convert BLOB data that's coming from MySQL database to Base64 and then displaying this to an jpg image.. here's the code am using:</p>
  
  <pre><code>using (MySql.Data.MySqlClient.MySqlConnection connection = new MySql.Data.MySqlClient.MySqlConnection("S;Port=P;Database=DB;Uid=U;Pwd=P"))
              {
                  connection.Open();
                 MySql.Data.MySqlClient.MySqlCommand cmd = connection.CreateCommand();
                 cmd.CommandText = "SELECT blobValue FROM Table WHERE blob_id = '333'";
  
                 MySql.Data.MySqlClient.MySqlDataReader datr = cmd.ExecuteReader();
                  if (datr.Read())
                  {
  
  
                      byte[] xx = (byte[])datr.GetValue(0);
  
                      string base64String = Convert.ToBase64String(xx, 0, xx.Length);
                      Image1.ImageUrl = "data:image/jpg;base64," + base64String;
  
                      }
  </code></pre>
  
  <p>I guess am not having a problem with the code, but when running the code i get an empty picture, like this one --> <img src="https://i.stack.imgur.com/F9aCc.jpg" alt="enter image description here"></p>
  
  <p>Please some help.</p>