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.
if (Found == "F")
{
if (txtPasswordInput.Text == txtConfirmPassword.Text)
{
DataRow drNewRow = m_dtLoginTable.NewRow(); //creates variable
drNewRow["Username"] = txtUsernameInput.Text;
drNewRow["Password"] = txtPasswordInput.Text;
m_dtLoginTable.Rows.Add(drNewRow);
m_dtDataAdapter.Update(m_dtLoginTable); database
m_rowPosition = m_dtLoginTable.Rows.Count - 1;
new record
}
else
{
txtError.Text = "Passwords do not match";
}
}
Loading

Bechir BejaouiRank #144 · 15.9K reputationPosted Nov 18, 2008, 12:07 PM EST
Ryan AlfordRank #1,411 · 1.2K reputationPosted Nov 19, 2008, 6:37 AM EST
harika m151 reputationPosted Nov 19, 2008, 7:19 PM EST
hi frnd,
jst paste ur insert statement so that we can resolve ur probs
Bechir BejaouiRank #144 · 15.9K reputationPosted Nov 20, 2008, 10:56 AM EST