i use this code to update data that are in the textboxes... this code is in the update button and once i made the changes and clicked the button the error message
Check in This Line
cmd.Parameters.Clear();
cmd.CommandText = "UPDATE contacts SET EMAIL = @EMAIL,
CELL_NO = @CELL_NO Where STUDENT_NO = @STUDENT_NO";
cmd.Parameters.AddWithValue("@EMAIL", email_txt.Text);
cmd.Parameters.AddWithValue("@CELL_NO", contact_txt.Text);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
Change To
cmd.Parameters.Clear();
cmd.CommandText = "UPDATE contacts SET EMAIL = @EMAIL,
CELL_NO = @CELL_NO Where STUDENT_NO = @STUDENT_NO";
cmd.Parameters.AddWithValue("@EMAIL", email_txt.Text);
cmd.Parameters.AddWithValue("@CELL_NO", contact_txt.Text);
cmd.Parameters.AddWithValue("@STUDENT_NOL",studentNo_txt.Text);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
you are clear the parameters, but after that use @STUDENT_NO
parameter. This parameter is not declare any where after clear ther parameters