paulthepaddy
Well-known member
hi all im geting this error
Syntax error in INSERT INTO statement.
with the following code, i dont know whats wrong as im following a guide
red code is giving the error
Syntax error in INSERT INTO statement.
with the following code, i dont know whats wrong as im following a guide
VB.NET:
Dim con As New OleDb.OleDbConnection
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\invoices.accdb"
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
con.Open()
da = New OleDb.OleDbDataAdapter("SELECT * FROM Invoices", con)
da.Fill(ds, "Invoices")
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("Invoices").NewRow()
dsNewRow.Item("Invoice Number") = Global_Variables.Invoice_Name
dsNewRow.Item("Date") = Format(System.DateTime.Today, "dd/MM/yy")
dsNewRow.Item("Customer") = Global_Variables.customer_Name
dsNewRow.Item("Amount") = Global_Variables.Total_Total
dsNewRow.Item("Paid") = False
ds.Tables("Invoices").Rows.Add(dsNewRow)
[COLOR=red]da.Update(ds, "Invoices")[/COLOR]
con.Close()