View Single Post
Join Date: Nov 2008
Posts: 5
Reputation: AW08 is an unknown quantity at this point 
Solved Threads: 0
AW08 AW08 is offline Offline
Newbie Poster

Database update error help

 
0
  #1
Nov 18th, 2008
I'm trying to write a questionnaire that gathers info of the user and then updates a database in Access. I've managed to write the program and everything works up to the point where it updates the database, at which point it displays the error message below:

OleDbException was unhandled
Syntax error in INSERT INTO statement

I've checked it and I can't find any syntax errors in it. Could someone help me out please? I'm very new to programming, so please try to explain in as simple terms as possible. The section of code is below. Thanks for your help.

  1. if (Found == "F")
  2. {
  3. if (txtPasswordInput.Text == txtConfirmPassword.Text)
  4. {
  5. DataRow drNewRow = m_dtLoginTable.NewRow(); //creates variable
  6. drNewRow["Username"] = txtUsernameInput.Text;
  7. drNewRow["Password"] = txtPasswordInput.Text;
  8. m_dtLoginTable.Rows.Add(drNewRow);
  9. m_dtDataAdapter.Update(m_dtLoginTable); database
  10. m_rowPosition = m_dtLoginTable.Rows.Count - 1;
  11. new record
  12. }
  13. else
  14. {
  15. txtError.Text = "Passwords do not match";
  16. }
  17.  
  18. }
Reply With Quote