private void Raw_material_Load(object sender, EventArgs e) { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; TopMost = false; dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 10); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; raw_materialdb rmdb = new raw_materialdb(); dataGridView1.DataSource = rmdb.selectall(); raw_materialdb idb = new raw_materialdb(); for (int i = 1; i < 7; i++) { raw_materialdb rdb = new raw_materialdb(); rdb.get(i); comboBox1.Items.Add(rdb.name); } }
private void Button3_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=DESKTOP-H03A9OV;Initial Catalog=daudfactorydb;Integrated Security=True"); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "update raw_material set quantity='" + 0 + "' where name='" + comboBox1.Text + "'"; cmd.ExecuteNonQuery(); raw_materialdb rdb = new raw_materialdb(); //edb.delete(textBox1.Text); dataGridView1.DataSource = rdb.selectall(); con.Close(); comboBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox1.Text = ""; dateTimePicker1.Text = ""; }