private void dgvUser_CellClick(object sender, DataGridViewCellEventArgs e) { try { DataTable dt = this.dgvUser.DataSource as DataTable; if (dt.Rows[e.RowIndex]["face"] != null) { object face_value = dt.Rows[e.RowIndex]["face"]; if (face_value != null) { byte[] face = face_value as byte[]; if (face != null) { this.picHead.Image = BytesHelper.ByteToImage(face); } else { this.picHead.Image = null; } } else { this.picHead.Image = null; } } } catch (Exception ex) { LogHelper.Error(ex); } }