private void dataGridView_check_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { int id = Convert.ToInt32(dataGridView_check.Rows[e.RowIndex].Cells[0].Value); string query = "SELECT ch_pic from checks WHERE ch_id=" + id + " and ch_pic IS NOT NULL"; Image img = db.SelectIMG(query); if (img != null) { new ShowPic(img).Show(); } else { MessageBox.Show("لا يوجد صوره"); } } catch { } }