Im getting the "Syntax error in INSERT INTO statement." at my
da.Update(ds, "Expenses") line in code... heres my full code to follow.
------------------------------------------------------------------------------------------------------------
Private Sub ConnectToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectToolStripMenuItem.Click
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\eneal\Desktop\BudgetingDatabase.mdb"
con.Open()
MsgBox("A Connection to the Database is now open")
sqlExp = "Select * FROM Expenses"
da = New OleDb.OleDbDataAdapter(sqlExp, con)
da.Fill(ds, "Expenses")
End sub
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommit.Click
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("Expenses").NewRow()
dsNewRow.Item("Expense Description") = Expense_DescriptionTextBox.Text
ds.Tables("Expenses").Rows.Add(dsNewRow)
da.Update(ds, "Expenses") ****This is the line my problems at*
MsgBox("New Record added to the Database")
End Sub
------------------------------------------------------------------------------------------------------
I've searched high an low to an answer for this problem but nothing has seemed remotly close to what I'm experiencing.