Ultrawhack
Well-known member
I am trying to filter a databound DGV from a combobox. All procedures are strictly read-only.
Access db. 2 tables Countries, Addresses.
Added datasource MyDb
on Data Designer added underlying Select Query to Addresses TableAdaptor
SELECT city + ', ' + State + ' ' + cstr(Zip) + chr(13) + chr(10) + Memo AS Log FROM Addresses
4 fields data is concatenated into single DGV column called Log
Datagridview's datasource = MyDbBindingsource
When form opens datagridview DGV fills perfectly.
combobox cboCountry is databound to Countries table.
When I select a country from cboCountry, DGV should simply filter and show selected country's data.
Filtering the bindingsource does not work as it does not seem to accept standard SQL
So I'm left with having to make changes to the TableAdaptor's underlying SQL.
Can someone please help me with this or suggest a better method ?
Thanks.
Access db. 2 tables Countries, Addresses.
Added datasource MyDb
on Data Designer added underlying Select Query to Addresses TableAdaptor
SELECT city + ', ' + State + ' ' + cstr(Zip) + chr(13) + chr(10) + Memo AS Log FROM Addresses
4 fields data is concatenated into single DGV column called Log
Datagridview's datasource = MyDbBindingsource
When form opens datagridview DGV fills perfectly.
combobox cboCountry is databound to Countries table.
When I select a country from cboCountry, DGV should simply filter and show selected country's data.
Filtering the bindingsource does not work as it does not seem to accept standard SQL
So I'm left with having to make changes to the TableAdaptor's underlying SQL.
Can someone please help me with this or suggest a better method ?
Thanks.
Last edited: