Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have set a combobox as follows:

 

 'set the bindings for the transaction description combobox

  Me.cboTransDescription.DataSource = glb_dbTransactionDescBinding

  Me.cboTransDescription.DisplayMember = "tran_description"

  Me.cboTransDescription.ValueMember = "tran_id"

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:

 

glb_taTransactionDesc.Fill(glb_dtTransactionDesc)

glb_dbTransactionDescBinding.DataSource = glb_dtTransactionDesc

and here is how I delete a record from the combobox but does not affect the database:

 

glb_dbTransactionDescBinding.Remove(glb_dbTransactionDescBinding.Current)

glb_taTransactionDesc.Update(glb_dtTransactionDesc)

Have I lost the plot and missed something important?

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...