Bhavesh Vankar

Bhavesh Vankar

  • 683
  • 1.1k
  • 87k

Listbox double click get image on image control

Jan 11 2021 10:33 AM
i have tried below code to get image on image control but when i double click image not getting and display like crack. what is wrong in this code. ?
 
i tried to display stored binary image from sql server to image control. 
after double click on listbox control.  
  1. string id = searchRecord.SelectedItem.Value;  
  2.                 if (dt.Rows.Count > 0)  
  3.                 {  
  4.                     byte[] bytes = (byte[])dt.Rows[0]["V_IMAGE"];  
  5.                     string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);  
  6.                     vImage.ImageUrl = "data:image/jpg;base64" + base64String;  
  7.   
  8.                 }  

Answers (3)