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. Web Development
  3. ASP.NET
  4. Databinding ASP.NET gridview using multithreading

Databinding ASP.NET gridview using multithreading

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-net
4 Posts 3 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.
  • A Offline
    A Offline
    afsal qureshi
    wrote on last edited by
    #1

    Hi, I have four gridview in my asp.net page. I want to call databind method asynchronouly. I don't want to call it sequentially as it consumes lot of time. What is the best way to do this? What are the potential issues of trying to do databaind operation in differnt thread for the same browser. Thanks in advance. Afsal

    E 1 Reply Last reply
    0
    • A afsal qureshi

      Hi, I have four gridview in my asp.net page. I want to call databind method asynchronouly. I don't want to call it sequentially as it consumes lot of time. What is the best way to do this? What are the potential issues of trying to do databaind operation in differnt thread for the same browser. Thanks in advance. Afsal

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      It will consume more time to populate if you do it asynchronously. The best way I have found to present the user with a loaded page and then load data after the page is rendered is with AJAX calls. The other method is to use an aysnc page but that is no fun.

      Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

      A 1 Reply Last reply
      0
      • E Ennis Ray Lynch Jr

        It will consume more time to populate if you do it asynchronously. The best way I have found to present the user with a loaded page and then load data after the page is rendered is with AJAX calls. The other method is to use an aysnc page but that is no fun.

        Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

        A Offline
        A Offline
        afsal qureshi
        wrote on last edited by
        #3

        Thanks for the reply. Well, I need to resolve this somehow. The issue I am facing now is four database calls altogether takes around 1 minute to retrieve the data. So I thought of making it into four different threads and binding it seperately. Are you sure it will not give me advantage? If I am loading everything at one shot, i am getting a "script taking longer time. Are you want to abort" like java script error message. Also, can you please explain your solution in a bit detail? May be by giving some links!

        F 1 Reply Last reply
        0
        • A afsal qureshi

          Thanks for the reply. Well, I need to resolve this somehow. The issue I am facing now is four database calls altogether takes around 1 minute to retrieve the data. So I thought of making it into four different threads and binding it seperately. Are you sure it will not give me advantage? If I am loading everything at one shot, i am getting a "script taking longer time. Are you want to abort" like java script error message. Also, can you please explain your solution in a bit detail? May be by giving some links!

          F Offline
          F Offline
          Fayu
          wrote on last edited by
          #4

          Multithreading may not be a solution here. The queries you are running dont seem very efficient. If these queries are taking one minute to run, than you might have to rethink what you are attempting. Here are a few suggestions: 1) Make sure your tables/views are indexed. If they are make sure your indexes are not fragmented. That will cause your queries to take longer than they should. 2) If you are using SELECT * and dont need all those columns, updatethe query to selec the columns you actually need. 3) Use stored procedures instead of inline queries. Stored procedures have an advantage because their statistics/execution plans are stored for future executions. This may increase the time it takes to run your query. 4) Make sure you dont have crazy joins. These are usually a major problem with complex, slow running queries. 5) If you are returing many many many rows, you may want to consider server side paging. Hope this helps.

          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