I'm connected to a database in a C# WPF Project
Aim is to create a dashboard outputting information
I've got StackPanels set up in the XAML and ListViews within the StackPanel
I had created a SQL Query for each ListView, and was told that wasn't very database efficient or code efficient
How do I manipulate an overall SQL query (with a limiting condition) but pulling down a lot of data and filter on elements to tailor the output?
I also need to be able to drill down into the data - as the SQL Query has at the moment a GROUP BY condition grouping on count, so I want to be able to see the data behind the total figures
Wim SturkenboomPosted Oct 18, 2014, 2:42 AM
I assume that you currently have a query that e.g. returns fields 1,2 and 3 for one listview, another query that returns fields 4,5 and 6 for another listview etc.
You can now create a query that e.g. returns 10 fields that you display in 3 listviews. You can populate the first listview with field1, field2 and field9, the second listview with field10, field8 and field1 (again) and the last listview with field 2 (again) and field3, field4, field5 and field6. The only field not used in this example is field7 of the result set.
For some other data that you want to display (and basically does not have a relation with the earlier data above), you can run another query that will return the required data for a couple of other listviews and do the same as above.
For the drill down, run queries that suite your needs ;-)
Note: no experience with WPF, XAML or ListViews so I can't give you a tailored answer.