private void btnSave_Click(object sender, EventArgs e) { if (this.picBoxImage.Image == null) { MessageBox.Show("No Image selected"); return; } try { Image img = this.picBoxImage.Image; byte[] arr = (byte[])(new ImageConverter()).ConvertTo(img, typeof(byte[])); HeadShotEngine.INSERT_OR_UPDATE_IMAGE("UPDATE_GUARD_IMAGE_LARGE", this.lbl_guid.Text, arr); MessageBox.Show("Update Successfull"); } catch (Exception exception) { MessageBox.Show(exception.ToString()); } }
private void btnSave_Click(object sender, EventArgs e) { if (picBoxImage.Image == null) { MessageBox.Show("No Image selected"); } else { try { Image img = picBoxImage.Image; byte[] arr; ImageConverter converter = new ImageConverter(); arr = (byte[])converter.ConvertTo(img, typeof(byte[])); HeadShotEngine.INSERT_OR_UPDATE_IMAGE("UPDATE_GUARD_HEAD_SHOT", lbl_guid.Text, arr); MessageBox.Show("Update Successfull"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }