Hi,
I have the following code to add a new item to my database.
But i only can see this new item after i close and open again my form.
How can i see the item immedeately without the need to close?
Thanks!
I have the following code to add a new item to my database.
Code:
Private Sub btnCommit_Click(sender As Object, e As EventArgs) Handles btnCommit.Click
' If inc <> -1 Then
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("AddressBook").NewRow()
dsNewRow.Item("FirstName") = txtFirstName.Text
dsNewRow.Item("Surname") = txtSurname.Text
ds.Tables("AddressBook").Rows.Add(dsNewRow)
da.Update(ds, "AddressBook")
MsgBox("New Record added to the Database")
btnCommit.Enabled = False
btnAddNew.Enabled = True
btnUpdate.Enabled = True
btnDelete.Enabled = True
' End If
End SubHow can i see the item immedeately without the need to close?
Thanks!