Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Best method for pulling and displaying multiple count queries as an aspx page??

Best method for pulling and displaying multiple count queries as an aspx page??

Scheduled Pinned Locked Moved Visual Basic
databasedata-structuresquestionlearningworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cavall
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • C cavall

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups