MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/visualbasic/comments/gn8qcr/urgent_saving_data_into_access_issue/fr8hetf/?context=3
r/visualbasic • u/bouoron • May 20 '20
16 comments sorted by
View all comments
2
Don't you need to commit your changes before closing?
3 u/bouoron May 20 '20 Dim cb As New OleDb.OleDbCommandBuilder(da)Dim dsNewRow As DataRowdsNewRow = ds.Tables("CustomerList").NewRow()dsNewRow.Item(0) = txtCustomerID.TextdsNewRow.Item(1) = txtCustomerName.TextdsNewRow.Item(2) = cboGender.TextdsNewRow.Item(3) = txtAddress.TextdsNewRow.Item(4) = txtContactNumber.Textds.Tables("CustomerList").Rows.Add(dsNewRow)da.Update(ds, "CustomerList")totalrecords = totalrecords + 1MsgBox("Registered") 1 u/RJohn12 May 20 '20 I've never used oledbcommanbuilders before, do you need to do an insert instead of an update?
3
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsNewRow As DataRow
dsNewRow = ds.Tables("CustomerList").NewRow()
dsNewRow.Item(0) = txtCustomerID.Text
dsNewRow.Item(1) = txtCustomerName.Text
dsNewRow.Item(2) = cboGender.Text
dsNewRow.Item(3) = txtAddress.Text
dsNewRow.Item(4) = txtContactNumber.Text
ds.Tables("CustomerList").Rows.Add(dsNewRow)
da.Update(ds, "CustomerList")
totalrecords = totalrecords + 1
MsgBox("Registered")
1 u/RJohn12 May 20 '20 I've never used oledbcommanbuilders before, do you need to do an insert instead of an update?
1
I've never used oledbcommanbuilders before, do you need to do an insert instead of an update?
2
u/stapper May 20 '20
Don't you need to commit your changes before closing?