The update script that you are generating here is wrong. It should be like below line
OleDbCommand update = new OleDbCommand("UPDATE user_details SET first_name = '" + textBox1.Text + "',last_name'" + textBox4.Text + "',course_name = '" +
textBox8.Text + "', DOJ = '" + textBox7.Text + "',father_name = '" + textBox2.Text + "',reg_fees='"+ textBox3.Text + "' where code = " + number + "", oleDbConnection);