Ok so I have this code. And I keep getting 'Syntax Error in INSERT INTO statement'. I've thrice checked it and I cant see any problem ;[
Any help would be fantastic!
Thanks
Dim sql As String
Dim carsDa As OleDb.OleDbDataAdapter
Dim carsDs As New DataSet
con.Open()
sql = "SELECT * FROM cars"
carsDa = New OleDb.OleDbDataAdapter(sql, con)
carsDa.Fill(carsDs, "Cars2")
Dim cb As New OleDb.OleDbCommandBuilder(carsDa)
Dim dsNewRow As DataRow
dsNewRow = carsDs.Tables("Cars2").NewRow()
dsNewRow.Item("customerID") = txtID.Text
dsNewRow.Item("make") = txtMake.Text
dsNewRow.Item("model") = txtModel.Text
dsNewRow.Item("reg") = txtReg.Text
dsNewRow.Item("year") = txtYear.Text
dsNewRow.Item("enginesize") = txtEngine.Text
carsDs.Tables("Cars2").Rows.Add(dsNewRow)
carsDa.Update(carsDs, "Cars2")
con.Close()
End Sub
Any help would be fantastic!
Thanks