DataAdapter.update(DataSet) gives the error message that syntax error to update the access database. Please help. Thanks.

  • Thread starter Thread starter Subhamoy Bhattacharjee
  • Start date Start date
S

Subhamoy Bhattacharjee

Guest
Imports System.Data.OleDb

Public Class Form1

Dim con As New OleDbConnection
Dim sql As String = "Select * from Table1"
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=H:\vb learning\Practice\Database1\Share list.accdb")
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "AddressBook")
con.Open()

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim cb As New OleDb.OleDbCommandBuilder(da)
ds.Tables("AddressBook").Rows(0).Item(3) = TextBox1.text
da.Update(ds, "AddressBook")
End Sub

End Class

Continue reading...
 
Back
Top