private void buttonSelectContact_Click(object sender, EventArgs e) { Select_Contact_Form SelectContactF = new Select_Contact_Form(); SelectContactF.ShowDialog(); try { int contactId = Convert.ToInt32(SelectContactF.dataGridView1.CurrentRow.Cells[0].Value.ToString()); CONTACT contact = new CONTACT(); DataTable table = contact.GetContactById(contactId); textBoxContactId.Text = table.Rows[0]["id"].ToString(); textBoxFName.Text = table.Rows[0]["fname"].ToString(); textBoxLName.Text = table.Rows[0]["lname"].ToString(); comboBoxGroup.SelectedValue = table.Rows[0]["group_id"]; textBoxPhone.Text = table.Rows[0]["phone"].ToString(); textBoxEmail.Text = table.Rows[0]["email"].ToString(); textBoxAddress.Text = table.Rows[0]["address"].ToString(); byte[] pic = (byte[])table.Rows[0]["pic"]; MemoryStream picture = new MemoryStream(pic); pictureBoxContactImage.Image = Image.FromStream(picture); } catch (Exception) { } }
private void buttonSelectContact_Click(object sender, EventArgs e) { Select_Contact_Form SelectContactF = new Select_Contact_Form(); SelectContactF.ShowDialog(); }