Loading Database Slow VB 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rusdyrip
    New Member
    • Jan 2008
    • 29

    Loading Database Slow VB 2005

    hi all,

    i have problem on loading large database
    i am using Firebird Database and VB.NET 2005

    it seems really slow to load 10.000+ row on DataGrid

    currently i use DataReader to open the database.

    is there any method to make it more faster.

    should I use DataSet or Data Adapter,
    i am confuse what should i use

    thx
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    That is not the problem of database, but of front end.

    But why you need to load 10000 + records in a grid ?

    Comment

    • rusdyrip
      New Member
      • Jan 2008
      • 29

      #3
      Originally posted by debasisdas
      That is not the problem of database, but of front end.

      But why you need to load 10000 + records in a grid ?


      some times my client need to view data from 2005 to 2007
      and i display it on grid.

      if i not load to grid,where should i load it?

      thx

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Originally posted by rusdyrip
        some times my client need to view data from 2005 to 2007
        and i display it on grid.

        if i not load to grid,where should i load it?

        thx
        Well..


        Instead you could only show 100 at a time in the data grid... create a next button and previous button to see next 100 and previous 100 records

        Is your client gonna look forward to looking through 10k+ records.
        Isnt a report better...(just something to consider)

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          I agree, the slow load time is probably related more to the datagrid than the database. However, you can test this assumption by skipping the database and loading 10,000 test rows into your datagrid. You might use random values, or the same value repeated over and over, for example.

          Comment

          • rusdyrip
            New Member
            • Jan 2008
            • 29

            #6
            i understand
            so the grid that takes long time to load

            i just confuse what the reason ,cause my customer always complaint.

            thx for the info

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Before looking too deeply into the "why" I believe you should ensure that you know the "what". We are all assuming that the problem is the datagrid. While I do agree this is probably the cause, you really should check it. A fundamental tenet of debugging is not to assume you know what the problem is, because you'll often be surprised.

              Also, is the grid bound to the data source, or are you just using your code to load the information into it a row at a time, or what? In my experience, most grid controls seem to fair poorly as a data repository. Or to put it another way, they seem to be designed more for presentation purposes, formatting things for display, rather than for efficient storage of a large amount of data.

              I'm not sure how much of this applies to the datagrid though - if I remember correctly, it more or less just puts a "face" on the data source. So the number of records may not have much effect on it.

              Comment

              • rusdyrip
                New Member
                • Jan 2008
                • 29

                #8
                Originally posted by Killer42
                Before looking too deeply into the "why" I believe you should ensure that you know the "what". We are all assuming that the problem is the datagrid. While I do agree this is probably the cause, you really should check it. A fundamental tenet of debugging is not to assume you know what the problem is, because you'll often be surprised.

                Also, is the grid bound to the data source, or are you just using your code to load the information into it a row at a time, or what? In my experience, most grid controls seem to fair poorly as a data repository. Or to put it another way, they seem to be designed more for presentation purposes, formatting things for display, rather than for efficient storage of a large amount of data.

                I'm not sure how much of this applies to the datagrid though - if I remember correctly, it's more or less just puts a "face" on the data source. So the number of records may not have much effect on it.
                i use my code just to load to datagrid without bound it to data source,
                i have try load 10000 row not from database, and it seems like the slow come from the grid.
                but i confuse why another application can show it on grid fast, i look at application like Firebird Maestro,it shows the row faster and it using grid too.

                thx for the information

                Comment

                • Killer42
                  Recognized Expert Expert
                  • Oct 2006
                  • 8429

                  #9
                  Originally posted by rusdyrip
                  i use my code just to load to datagrid without bound it to data source,
                  i have try load 10000 row not from database, and it seems like the slow come from the grid.
                  Ok, thanks. I'm glad we've got that confirmed. Hopefully we can ignore the database side of things, then.

                  Originally posted by rusdyrip
                  but i confuse why another application can show it on grid fast, i look at application like Firebird Maestro,it shows the row faster and it using grid too.
                  Ah, but is it the same grid control? There are big differences in the way some of them work.

                  Also, can you show us the code which populates the grid? Perhaps there's something inherently slow there. For example (I'm just making this up) if there are methods to load a row or a cell at a time, loading cell by cell might take a lot longer. Or perhaps your code is doing some very slow transformation of the data before loading it to each row of the grid.

                  There are all sorts of possibilities.

                  Keep in mind though, that it's often possible to make an application seem faster, even when it really isn't. This can be done by things like providing user feedback on the process rather than leaving the user to wonder what's going on. The "splash screen" is a prime example. By showing the user that something is happening, they make the load time of the application seem much shorter.

                  Another possibility might be to continue loading data in the background while the user interacts with the application, instead of making them wait until it's all loaded.

                  Or, you might be able to find a grid control which works faster.

                  Or keep the data in an array (or database) and only load enough of it into the grid to populate the screen. In fact, I've seen grid controls (many years ago, forget the details) which allow you to "bind" them to your own event procedure which provides the data. So you can treat the data control as though it is bound to a data source, but the source is your own code, which can be getting the data from anywhere you like (even creating it on the fly, or whatever).

                  Comment

                  Working...