private void dgv_konyvek_CellClick(object sender, DataGridViewCellEventArgs e) { connectionString.Open(); var result = new SqlCommand("select * from konyv inner join szerzo on konyv.szerzoId = szerzo.Id where konyv.id = " + int.Parse(dgv_konyvek.Rows[e.RowIndex].Cells[0].Value.ToString()) + "; ", connectionString).ExecuteReader(); result.Read(); var konyv = new KonyvModel() { Id = result.GetInt32(0), Cim = result.GetString(1), SzerzoId = result.GetInt32(2), Helyezes = result.GetInt32(3) }; connectionString.Close(); result.Close(); var frm = new FrmKonyv(connectionString, false, konyv); frm.ShowDialog(); }
private void ujKonyvToolStripMenuItem_Click(object sender, EventArgs e) { var frm = new FrmKonyv(connectionString, true, null); frm.ShowDialog(); }