I am using the following code for displaying table data in controls on a form:
I do not fully understand the workings of this, so when the control is a combobox and it doesn't work correctly I am pretty much unable to explain why.Code:txtOwner.DataBindings.Add(New Binding("Text", _MasterBase5_0DataSet, "tblValMaster.strOwner"))
The "Text" part of the above code behaves as expected. However, the "ValueMember" and "Display" member do not. Nothing shows from either of them. I suspect that it has something to do with the fact that it is the, "Binding" that causes the behavior.Code:With cmbType .DataBindings.Add(New Binding("ValueMember", _MasterBase5_0DataSet, "lkpValType.strValType")) .DataBindings.Add(New Binding("DisplayMember", _MasterBase5_0DataSet, "lkpValType.strValType")) .DataBindings.Add(New Binding("Text", _MasterBase5_0DataSet, "tblValMaster.strValType")) End With
lkpValType is a lookup table that serves in the place of a collection that might be found in a combobox. So what should be showing is the list from table lkpValType.
Can anyone explain to me what I am doing wrong here?




Reply With Quote
