string menu = "";
        if (RadioButton3.Checked)
            menu = menu + " " + RadioButton3.Text;
        if (RadioButton4.Checked)
            menu = menu + " " + RadioButton4.Text;
        if (RadioButton5.Checked)
            menu = menu + " " + RadioButton5.Text;
        if (RadioButton6.Checked)
            menu = menu + " " + RadioButton6.Text;
        TextBox4.Text = menu;
 OleDbCommand cmd = new OleDbCommand("insert into bill(name,contact,address,order) values(@a1,@a2,@a3,@a4)", con);
        if (RadioButton1.Checked)
            cmd.Parameters.AddWithValue("a1", RadioButton1.Text+TextBox1.Text);
        else  if (RadioButton2.Checked)
            cmd.Parameters.AddWithValue("a1", RadioButton2.Text+TextBox1.Text);
        else cmd.Parameters.AddWithValue("a1", TextBox1.Text);
        cmd.Parameters.AddWithValue("a2", TextBox2.Text);
        cmd.Parameters.AddWithValue("a3", TextBox3.Text);
        cmd.Parameters.AddWithValue("a4", TextBox4.Text );
con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

This is my code, the fourth parameter value is not getting add to my database. Also note that there is no restrictions placed in the db column (order)

Related posts

Recent Viewed