I am trying to insert data into an Access database with C#. The error I receive is
Insert Into Statement syntax error
The code is
textBox5.Text = ins; //string value
string into = "INSERT INTO customersales(c-invoiceNo,c-invoiceDate, c-discount, c-rant,c-paid, c-due) values ('" +textBox5.Text.ToString() + "'," + dateTimePicker1.Text + "," + diccombo.Text.Trim() + "," + GRANTTXT.Text + "," + TXTPAID.Text + ","+ txtdue.Text + ")";
con.Open();
cmd = new OleDbCommand(into, con);
cmd.ExecuteNonQuery();
con.Close();
Table name : customersales
columnname :
id (autonumber) c-invoiceNo (text) c-invoiceDate (date/time) c-discount (currency) c-grant (currency) c-paid (currency) c-due (currency)
intointo a query window in MS Access. Does it work?