public void updateImage(string phone, string clientID, string isfrom) { try { MySQLBusinessLogic bl = new MySQLBusinessLogic(); int storeID = GetStoreIDbyPhone(phone); DataTable dt = bl.GetStoreImage(storeID); byte[] bytes = (Byte[])dt.Rows[0].ItemArray[0]; if (bytes.Length < 16777216) { string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); string ImageUrl = "data:image/png;base64," + base64String; Clients.Client(clientID).storeImgPath(ImageUrl, "1", isfrom); } else Clients.Client(clientID).storeImgPath("", "0", isfrom); } catch (Exception ex) { Clients.Client(clientID).storeImgPath("", "0", isfrom); } }