I am having trouble inserting records into my database from a form with textboxs.
Here is the code for the add button however data is not adding to the database.
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
btnadd.Enabled = True
btmupdate.Enabled = True
btndelete.Enabled = True
End If
I would be greatefull this someone could tell me where i am goin wrong.
Thanks