D
Douglas Buchanan
How do I define the desired DataAdapter at runtime?
A ComboBox is used to select the desired table. The selected value is
the name of the table to be loaded into the datagrid.
My solution works but seems less than elegant.
(Also the Cast to string of the combobox selected value seems awkward.
Any suggestions? - it did not support .ToString() and I could not
firure out why.)
Suggestions please.
====== Code showing my best effort =======
'Get the ValueMember from the cbo
Dim sTableName As String
sTableName = CStr(cboSelectTableOwnerTables.SelectedValue)
Me.dgOwnerTables.DataMember = sTableName
Select Case sTableName
Case "lst1SelectionListMenu"
Me.daSelectionList.Fill(DsLists1,
"lst1SelectionListMenu")
Case "lst2GroupSubListMenu"
Me.daGroupSubList.Fill(DsLists1,
"lst2GroupSubListMenu")
End Select
A ComboBox is used to select the desired table. The selected value is
the name of the table to be loaded into the datagrid.
My solution works but seems less than elegant.
(Also the Cast to string of the combobox selected value seems awkward.
Any suggestions? - it did not support .ToString() and I could not
firure out why.)
Suggestions please.
====== Code showing my best effort =======
'Get the ValueMember from the cbo
Dim sTableName As String
sTableName = CStr(cboSelectTableOwnerTables.SelectedValue)
Me.dgOwnerTables.DataMember = sTableName
Select Case sTableName
Case "lst1SelectionListMenu"
Me.daSelectionList.Fill(DsLists1,
"lst1SelectionListMenu")
Case "lst2GroupSubListMenu"
Me.daGroupSubList.Fill(DsLists1,
"lst2GroupSubListMenu")
End Select