private void dataGridView1_MouseClick(object sender, MouseEventArgs e) { string id = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); inventorydb idb = new inventorydb(); idb.get(Int32.Parse(id)); //textBox1.Text = idb.name; //MessageBox.Show(id); }
private void inventory_Load(object sender, EventArgs e) { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; TopMost = false; dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 16); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; inventorydb idb = new inventorydb(); dataGridView1.DataSource = idb.selectall(); }