private void Button8_Click(object sender, EventArgs e) { try { m.Close(); m.Open(); SqlCommand cmd = new SqlCommand("update [dbo].[seed] set Sname = '" + textBox2.Text + "', Type = '" + textBox3.Text + "', Rate = '" + textBox4.Text + "', Quantity = '" + textBox5.Text + "' where Sid='" + textBox1.Text + "'", m); int a = cmd.ExecuteNonQuery(); if (a > 0) { MessageBox.Show("Updated"); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); this.Hide(); SeedReport f1 = new SeedReport(); f1.Show(); } else { MessageBox.Show("Invalid"); } m.Close(); } catch { MessageBox.Show("Error!!"); } }
private void Button7_Click(object sender, EventArgs e) { try { m.Close(); m.Open(); SqlCommand cmd = new SqlCommand("delete from [dbo].[seed] where Sid='" + textBox1.Text + "'", m); int a = cmd.ExecuteNonQuery(); if (a > 0) { MessageBox.Show("Deleted"); textBox1.Clear(); this.Hide(); SeedReport f1 = new SeedReport(); f1.Show(); } else { MessageBox.Show("Invalid"); } m.Close(); } catch { } }
private void Button7_Click(object sender, EventArgs e) { SeedReport s1 = new SeedReport(); this.Hide(); s1.Show(); }