May 23, 2011
I have a search form on that will be pulling search template queries from a table in the underlying (an Access db on a share). The search form has a calendar control for filtering by date range, a listbox containing the names of the search templates, a second listbox which lists the fields in the selected template, and then some controls which show/hide themselves depending on which field is selected so that the user can pick a field and enter it's unique criteria in the appropriate control for filtering. Below these controls is a DataGrid, which will obviously display the results.
View 1 Replies
The problem is how to dynamically "transform" this DataGrid to display the selected search template. These templates do not represent tables in the underlying; rather they represent preconstructed SQL queries (stored in a table) which are essentially SELECT queries with joins and no WHERE clause (so they are the results of multiple tables joined together by their keys).
To be honest, I'm having trouble even generating the LINQ queries to represent these template dynamically, but that's not as important, since I can manually translate the SQL queries into LINQ. This is definitely not the preferred method, as the whole point of putting these templates in a table, rather than code, was to allow for future additions without rebuilding/redistributing the application interface.