Textboxes wont update from Child Tables
The dataset gets populated OK.
dataset ("tblAdapters") has 5 tables:
Table: Configurations
Fields:
MACAddress
Index
Description (Key)
DNSDomain
DNSHostname
PrimaryWINS
SecondaryWINS
ConfigType
Table: IPAddr
Fields:
AdapterDesc (Key)
Index
IPAddress
Table: SubnetAddr
Fields:
AdapterDesc (Key)
Index
IPAddress
Table: GatewayAddr
Fields:
AdapterDesc (Key)
Index
IPAddress
Table: DNSAddr
Fields:
AdapterDesc (Key)
Index
IPAddress
The relations are:
"ConfigsDNSAddress", "ConfigsIPAddr", "ConfigsGatewayAddr", and "ConfigsSubnetAddr" All relations link Configurations.Description to Subtable.AdapterDesc.
I force the DNSAddr subtable to have 3 rows, even if IPAddresses are "".
Configurations.Description displays in a combobox ("cboAdapters"). All the other data fields are in textboxes.
In form_load:
WithMe.cboAdapter
.DataSource = tblAdapters.Configuration
.DisplayMember = "Description"
EndWith
WithMe
.txtMAC.DataBindings.Add(New Binding("Text", tblAdapters.Configuration, "MACAddress"))
.txtDHCP.DataBindings.Add(New Binding("Text", tblAdapters.Configuration, "ConfigType"))
.txtWINS1.DataBindings.Add(New Binding("Text", tblAdapters.Configuration, "PrimaryWINS"))
.txtWINS2.DataBindings.Add(New Binding("Text", tblAdapters.Configuration, "SecondaryWINS"))
.txtDNSDomain.DataBindings.Add(New Binding("Text", tblAdapters.Configuration, "DNSDomain"))
.txtIPAddr.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsIPAddress").ChildTable.Select("Index = 0"),"IPAddress"))
.txtSubnet.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsSubnetAddress").ChildTable.Select("Index = 0"), "IPAddress"))
.txtDefGW.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsGatewayAddress").ChildTable.Select("Index = 0"), "IPAddress"))
.txtDNS1.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsDNSAddress").ChildTable.Select("Index = 0"), "IPAddress"))
.txtDNS2.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsDNSAddress").ChildTable.Select("Index = 1"), "IPAddress"))
.txtDNS3.DataBindings.Add(New Binding("Text", tblAdapters.Relations("ConfigsDNSAddress").ChildTable.Select("Index = 2"), "IPAddress"))
EndWith
Here's the problem:
When the form loads, the combobox and all the textboxes are filled with correct data from the dataset.
However, when the combobox selection is changed, all the textboxes which have bindings that do not reference a relation change correctly. The ones which use the format "tblAdapters.Relations("RelationName").ChildTable.Select("Index = 0")" do not.
How can I fix this?
Thanks
Rob

