I have set a combobox as follows:
This successfully populates the combobox and also allows me to add items which appear in the combobox.
I want to be able to delete the selected item in the combobox and found on this site that one should use a bindingsource to do so which I did and it does get removed from the combobox but I have found that neither adding or deleting affects the actual database.
Here is how I setup the bindingsource:
and here is how I delete a record from the combobox but does not affect the database:
Have I lost the plot and missed something important?
Thanks
Code:
set the bindings for the transaction description combobox
Me.cboTransDescription.DataSource = glb_dbTransactionDescBinding
Me.cboTransDescription.DisplayMember = "tran_description"
Me.cboTransDescription.ValueMember = "tran_id"
I want to be able to delete the selected item in the combobox and found on this site that one should use a bindingsource to do so which I did and it does get removed from the combobox but I have found that neither adding or deleting affects the actual database.
Here is how I setup the bindingsource:
Code:
glb_taTransactionDesc.Fill(glb_dtTransactionDesc)
glb_dbTransactionDescBinding.DataSource = glb_dtTransactionDesc
Code:
glb_dbTransactionDescBinding.Remove(glb_dbTransactionDescBinding.Current)
glb_taTransactionDesc.Update(glb_dtTransactionDesc)
Thanks