In the code at the very start
string str = "INSERT INTO Sales (Invoice,CustomerName,SaleDate,TotalAmt,VAT,Discount,TotalPayAmt,Paid,Balance) VALUES ("+ Invoice_tx.Text +", '"+ CustomerName_cb.Text +"', '"+ SaleDate_dt.Value.Date.ToString() +"', "+ TotalAmnt_tx.Text +", "+ VAT_tx.Text +", "+ Discount_tx.Text +", "+ TotalPayAmnt_tx.Text +", "+ Paid_tx.Text +", "+ Balance_tx.Text +") ";
you have a non-printing character in the
+", "+
between
TotalPayAmnt_tx.Text
and
Paid_tx.Text
.
In fact if I paste that section into, say the VBE in Excel it shows as
TotalPayAmnt_tx.Text +",??? "+ Paid_tx.Text
It's those ??? that are causing your syntax error.
If you follow the advice of Patrice T (@ppolymorphe) in Solution 2, and use Parameterized queries then the problem unfortunately won't go away (which is unusual in these cases) - the solution is to delete that character that looks like a space, but which isn't.
But you really, really should use parameterized queries as well e.g. (untested)
string str = "INSERT INTO Sales (Invoice,CustomerName,SaleDate,TotalAmt,VAT,Discount,TotalPayAmt,Paid,Balance) VALUES (?,?,?,?,?,?,?,?,?)";
OleDbDataAdapter da = null;
da.SelectCommand.Parameters.Add("invoice",OleDbType.VarChar, 100).Value = Invoice_tx.Text;