private void button2_Click(object sender, EventArgs e) { DLbh bbhh = DLbh.getIns(); int id = bbhh.Num; DBTools db = new DBTools(".", "wkdl", true, "sa", "wdxg"); SqlDataReader b = db.getResult("delete from ware where id=" + id); MessageBox.Show("Delete successfully!"); LoadDGV(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { x = e.RowIndex; y = e.ColumnIndex; if (x != -1) { DLbh bbhh = DLbh.getIns(); string ssss = dataGridView1.Rows[x].Cells[0].Value.ToString(); bbhh.Num = int.Parse(ssss); } }