PDA

View Full Version : Syntax error in INSERT INTO statement.


m_tavakoli
08-08-2010, 09:41 AM
hi , everybody
my code in c# is as bellow , but in *** line the error message "Syntax error in INSERT INTO statement." at runtime is displayed.

void give_order(int num, int t, int ord)
{
conStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\supply_chain.accdb";
con = new OleDbConnection(conStr);
con.Open();
newr = ds.Tables["assignment"].NewRow();
newr["ID"] = num;
newr["period"] = t;
newr["order"] = ord;
ds.assignment.Rows.Add(newr);
strsql = "SELECT * FROM assignment";
OleDbDataAdapter da = new OleDbDataAdapter(strsql, con);
cb = new OleDbCommandBuilder(da);
da = cb.DataAdapter;
da.Update(ds, "assignment");
con.Close();
}
thanks a lot :D

abduraooft
08-09-2010, 09:16 AM
I don't see any INSERT statements in the above posted code. The error might be somewhere else.