C# problem with ADO
- by ahmed
When i use the following code, i get this error :
"OleDbexception Syntax error in INSERT INTO statement.
plz help me!
{
// add the new username
System.Data.OleDb.OleDbCommandBuilder cb;
cb = new System.Data.OleDb.OleDbCommandBuilder(da);
DataRow dRow = cPD_DatabaseDataSet.Tables["users_table"].NewRow();
dRow[0] = this.textBox_add_user.Text ;
dRow[1] = this.textBox_password.Text ;
cPD_DatabaseDataSet.Tables["users_table"].Rows.Add(dRow); //add new record
cb.GetUpdateCommand();
cb.GetInsertCommand();
//save new recode into the Access file
da.Update(cPD_DatabaseDataSet, "users_table");
//clear textboxes
this.textBox_add_user.Text = "";
this.textBox_password.Text = "";
this.textBox_re_password.Text = "";
}
catch (System.Data.OleDb.OleDbException exp)
{
//close the connection
this.con.Close();
MessageBox.Show(exp.ToString());
}`