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. C#
  4. how to load data faster from Sql Server into combobox

how to load data faster from Sql Server into combobox

Scheduled Pinned Locked Moved C#
databasesql-serversysadminhelptutorial
12 Posts 9 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.
  • S Offline
    S Offline
    sudhir behera
    wrote on last edited by
    #1

    hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

    L K realJSOPR A P 6 Replies Last reply
    0
    • S sudhir behera

      hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      My suggestion is, don't bind to the combo box. 134000 is plainly too many items for the user to look through. You will be much better off providing the user with the ability to search for an item. Also, it's considered bad form to write "it's urgent" in message boards posts (kindly read the FAQs), as it is only urgent to you.

      Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter. Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

      1 Reply Last reply
      0
      • S sudhir behera

        hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        sudhir behera wrote:

        134000 records in my ... combo box

        :omg:

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        Prolific encyclopedia fixture proof-reader browser patron addict?
        We all depend on the beast below.


        M 1 Reply Last reply
        0
        • S sudhir behera

          hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          sudhir behera wrote:

          opening the page.it is taking 45 seconds to load data from sql serer into combo box

          I'm surprised you did not get an "out of memory" error or something. I dont think the user is going to like scrolling through soooo many records - think of a different strategy - dont use a combo box.

          1 Reply Last reply
          0
          • S sudhir behera

            hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #5

            sudhir behera wrote:

            have 134000 records ... binded ... in the combo box

            There's no fix for "stupid". Your best hope is that a competent programmer take over the project.

            .45 ACP - because shooting twice is just silly
            -----
            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

            M P M 3 Replies Last reply
            0
            • L Luc Pattyn

              sudhir behera wrote:

              134000 records in my ... combo box

              :omg:

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              Prolific encyclopedia fixture proof-reader browser patron addict?
              We all depend on the beast below.


              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              Oh shit, I needed a good laugh. Now I have to try and explain that the the significant other.

              Never underestimate the power of human stupidity RAH

              1 Reply Last reply
              0
              • realJSOPR realJSOP

                sudhir behera wrote:

                have 134000 records ... binded ... in the combo box

                There's no fix for "stupid". Your best hope is that a competent programmer take over the project.

                .45 ACP - because shooting twice is just silly
                -----
                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                -----
                "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                I looked at Luc's first because it had a 5 vote... and cracked up, ahh I enjoyed that.

                Never underestimate the power of human stupidity RAH

                realJSOPR 1 Reply Last reply
                0
                • M Mycroft Holmes

                  I looked at Luc's first because it had a 5 vote... and cracked up, ahh I enjoyed that.

                  Never underestimate the power of human stupidity RAH

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  I'm just callin' 'em like I see 'em... :)

                  .45 ACP - because shooting twice is just silly
                  -----
                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                  1 Reply Last reply
                  0
                  • S sudhir behera

                    hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    sudhir behera wrote:

                    please help me how will make it faster

                    By loading a lot less data.

                    "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                    As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                    My blog | My articles | MoXAML PowerToys | Onyx

                    1 Reply Last reply
                    0
                    • realJSOPR realJSOP

                      sudhir behera wrote:

                      have 134000 records ... binded ... in the combo box

                      There's no fix for "stupid". Your best hope is that a competent programmer take over the project.

                      .45 ACP - because shooting twice is just silly
                      -----
                      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                      -----
                      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #10

                      Alas; artificial intelligence is no match for organic stupidity.

                      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                      My blog | My articles | MoXAML PowerToys | Onyx

                      1 Reply Last reply
                      0
                      • S sudhir behera

                        hii, i have 134000 records in my table.i have binded one field in the combo box.when i am opening the page.it is taking 45 seconds to load data from sql serer into combo box.please help me how will make it faster.its urgents.i have to wait 45 seconds for making any transaction.

                        D Offline
                        D Offline
                        Dan Mos
                        wrote on last edited by
                        #11

                        Try using a System.Terror to load the datas. :-\ OK, really bad design. You should let the user search or at least provide some sort of paging or... - But, as a small improvement to whatever you have, you could unbind the combo, get all the datas in a array of strings using a datareader then use the Items.AddRange(); - also wraping the whole filling of the combo in a "comboBox1.BeginUpdate(); ... comboBox1.EndUpdate);" should help a little. Again, bad design. But still 45 secs seems way to much for 134000 strings/records.

                        1 Reply Last reply
                        0
                        • realJSOPR realJSOP

                          sudhir behera wrote:

                          have 134000 records ... binded ... in the combo box

                          There's no fix for "stupid". Your best hope is that a competent programmer take over the project.

                          .45 ACP - because shooting twice is just silly
                          -----
                          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                          -----
                          "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                          M Offline
                          M Offline
                          mansink1
                          wrote on last edited by
                          #12

                          I too giggled the first time I saw this posting and now I am in a similar predicament. I have a client who has had enough of the data entry errors his staff constantly makes while entering chemical names by hand. So we have a combo box with an autofill function, so if they type 'Alc' the combobox will display all records that start with 'Alc'. There are 3 of these combo boxes each one with over 25,000 items. The page takes 4 seconds in loading. The client is happy, I of course i'm not.

                          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