Hi Guys, <-- Newbie Here!
I seem to have an issue with an INSERT INTO statement when trying to add some textbox data into a DataSet and then update the backend table called 'cashOrders' in a Access Databse.
The Following code is being run from the 'Save Button'
private void btnOrderSave_Click(object sender, EventArgs e)
{
System.Data.OleDb.OleDbCommandBuilder cb;
cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA);
cashOrdersTable.TableName = "cashOrders";
DataRow DRO = cashOrdersDS.Tables["cashOrders"].NewRow();
DRO["QTY"] = Int64.Parse(txtOrderQTY.Text);
DRO["Description"] = txtBoxDescrip.Text.ToString();
DRO["Supplier"] = txtBoxSupplier.Text.ToString();
DRO["Date"] = dateTimePicker1.Text.ToString();
DRO["Cost"] = decimal.Parse(txtBoxCost.Text);
DRO["Sell"] = decimal.Parse(txtBoxSell.Text);
DRO["cashAccountRef_FKID"] = Int64.Parse(textBox1.Text);
cashOrdersDS.Tables["cashOrders"].Rows.Add(DRO);
cashDA.Update(cashOrdersDS.Tables["cashOrders"]);
MessageBox.Show("Added");
}
Currently when Debugging and stepping through the Code it seems to get through until the final 'update' section. Where I get the following error message:
Syntax error in INSERT INTO statement.
Is anyone able to point me in the direction I am meant to look to resolve this issue?
If you need more code I could be happy to reply with is and help where I can.
Regards
Mark.