Best method for pulling and displaying multiple count queries as an aspx page??
-
I have about 6-10 different moderately complex queries that are returning a count. I am wanting to figure out the best, most efficient method for running those queries and displaying the counts either in a table or a datagrid type view. Currently, I have a function that gets all the SQL Commands that I need and places them in and array. I setup a data adapter and fill a separate table on a dataset for each Count query I have. TO display I set a table's specific cells to show the dataset.tables("whatever").row(0).Item(0) It seems to take quite a long time for this method.... Does someone know something better?? I am still a beginner so any advice would be helpful. Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
-
I have about 6-10 different moderately complex queries that are returning a count. I am wanting to figure out the best, most efficient method for running those queries and displaying the counts either in a table or a datagrid type view. Currently, I have a function that gets all the SQL Commands that I need and places them in and array. I setup a data adapter and fill a separate table on a dataset for each Count query I have. TO display I set a table's specific cells to show the dataset.tables("whatever").row(0).Item(0) It seems to take quite a long time for this method.... Does someone know something better?? I am still a beginner so any advice would be helpful. Thanks cavall "Nothing is at last sacred, but the integrity of your own mind." "What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
From your description, is would appear that 99% of the time it takes to come up with the final result is being taken up by the SQL queries themselves. The code to put the final table with the results is nearly nothing. If these queries are static, meaning you always use the same set of queries the same way, then you might want to look into have the SQL Server run a stored procedure that runs all of your queries for you and returns a small table with the results you want. Then, you would only have to write code to handle the returned table of results, bind your datagrid to it, and not worry about
dataset.tables("whatever").row(0).Item(0)
. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome