private void button1_Click(object sender, EventArgs e) { if (validation() == 0) { errorProvider1.Clear(); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "insert into vehicle values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox5.Text + "','" + comboBox1.Text + "''" + textBox6.Text + "','" + textBox8.Text + "','" + textBox9.Text + "')"; cmd.ExecuteNonQuery(); con.Close(); diplay_data(); MessageBox.Show("Record Inserted Suuccesfully !"); this.Close(); Vehical_master vm = new Vehical_master(); vm.Show(); } }
private void vehiclesToolStripMenuItem_Click(object sender, EventArgs e) { Vehical_master vm = new Vehical_master(); vm.Show(); }