Beispiel #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            conn.oleDbConnection1.Open();
            OleDbCommand cmd = new OleDbCommand("insert into Customer (CID,Cname,City,PH1,ContactPerson,CreditLimit,CStatus,CGroup) values(@CID,@Cname,@CAddress,@City,@ContactPerson,@CreditLimit,@CStatus,@CGroup)", conn.oleDbConnection1);

            cmd.Parameters.AddWithValue("@CID", textBox1.Text);
            cmd.Parameters.AddWithValue("@Cname", textBox2.Text);
            cmd.Parameters.AddWithValue("@City", textBox3.Text);
            cmd.Parameters.AddWithValue("@PH1", textBox4.Text);
            cmd.Parameters.AddWithValue("@ContactPerson", textBox5.Text);
            cmd.Parameters.AddWithValue("@CreditLimit", textBox6.Text);
            cmd.Parameters.AddWithValue("@CStatus", textBox7.Text);
            cmd.Parameters.AddWithValue("@CGroup", comboBox1.Text);
            //CGroup
            cmd.ExecuteNonQuery();
            conn.oleDbConnection1.Close();
            MessageBox.Show(" Sent for Approval");
            this.Hide();
            Form11 f11 = new Form11();

            f11.Show();
        }