cmd = new OleDbCommand("update FINAL set STATE_CODE=@STATE_CODE,DAC_CODE=@DAC_CODE,SCHOOL_CODE=@SCHOOL_CODE,STUD_TYPE=@STUD_TYPE,SLNO=@SLNO,NAME=@NAME,CLASS=@CLASS,SECTION=@SECTION,REGNO=@REGNO,OP=@OP,PRI_FLG=@PRI_FLG,SERIAL_GEN_FLG=@SERIAL_GEN_FLG where FILE_NO=" + textBox1.Text.ToString() + "", con);
            cmd.Parameters.AddWithValue("@FILE_NO", textBox1.Text);
            cmd.Parameters.AddWithValue("@STATE_CODE", textBox2.Text);
            cmd.Parameters.AddWithValue("@DAC_CODE", textBox3.Text);
            cmd.Parameters.AddWithValue("@SCHOOL_CODE", textBox4.Text);
            cmd.Parameters.AddWithValue("@STUD_TYPE", textBox5.Text);
            cmd.Parameters.AddWithValue("@SLNO", textBox6.Text);
            cmd.Parameters.AddWithValue("@NAME", textBox7.Text);
            cmd.Parameters.AddWithValue("@CLASS", textBox8.Text);
            cmd.Parameters.AddWithValue("@SECTION", textBox9.Text);
            cmd.Parameters.AddWithValue("@REGNO", textBox10.Text);
            cmd.Parameters.AddWithValue("@OP", textBox11.Text);
            cmd.Parameters.AddWithValue("@PRI_FLG", textBox12.Text);
            cmd.Parameters.AddWithValue("@SERIAL_GEN_FLG", textBox13.Text);
            int n = cmd.ExecuteNonQuery();
            if (n > 0)
            {
                MessageBox.Show("Record Updated");
            }

how to overwrite this error syntax error in update statement in C# .net coding

what prob u have with this code dear

Maybe access (.mdb) file is readonly or you don't have permission to write in it.

Use also
cmd.parameters.oledbType=oledbtype.int
use only add.
cmd.Parameters.Add("@SECTION", textBox9.Text);

cmd.Parameters.AddWithValue("@SECTION", textBox9.Text);

try this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.