im new in using ole db and i could’nt solve my problem here. not sure if im missing some codes.
after clicking the save button and closing the program, when you open it again, the record will not show (not actually saved!). I need to add, edit and delete a record.
please help. thanks.
If strMode = “addmode” Then
dr = dt.NewRow()
dr(“ISBN”) = txtISBN.Text
dr(“Title”) = txtTitle.Text
dr(“Year Published”) = txtYear.Text
‘dt = ds.Tables(0)
dt.Rows.Add(dr)
myAdapter.AcceptChangesDuringFill = True
dr.AcceptChanges()
dr.BeginEdit()
Me.myAdapter.Update(ds)
MessageBox.Show(“Added new record!”)
ElseIf strMode = “editmode” Then
‘cm = currencymanager
dt.Rows(cm.Position).Item(“ISBN”) = txtISBN.Text
dt.Rows(cm.Position).Item(“Title”) = txtTitle.Text
dt.Rows(cm.Position).Item(“Year Published”) = txtYear.Text
Me.myAdapter.Update(ds)
MessageBox.Show(“Record Updated!”)
End If