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. Database & SysAdmin
  3. Database
  4. How do i solved Timeout Expired Error in ASP.net with Backend as SQL 2008

How do i solved Timeout Expired Error in ASP.net with Backend as SQL 2008

Scheduled Pinned Locked Moved Database
csharpasp-netdatabasesysadminhelp
6 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.
  • P Offline
    P Offline
    Pratibha Mhatre
    wrote on last edited by
    #1

    I am getting following server error in asp.net application, even i mentioned Max Pool Size="100" in web.config file Error : "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may occurred because all pooled connections were in use and max pool size was reached."

    L 1 Reply Last reply
    0
    • P Pratibha Mhatre

      I am getting following server error in asp.net application, even i mentioned Max Pool Size="100" in web.config file Error : "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may occurred because all pooled connections were in use and max pool size was reached."

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Are you closing and disposing your connections once you execute a query?

      Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

      D P 2 Replies Last reply
      0
      • L Lost User

        Are you closing and disposing your connections once you execute a query?

        Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        Yup. That was exactly what I was going to suggest. I ran into that problem where I had forgotten to close and dispose my SQL connections and the problem didn't show up until I had more people using the system.

        P 1 Reply Last reply
        0
        • L Lost User

          Are you closing and disposing your connections once you execute a query?

          Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

          P Offline
          P Offline
          Pratibha Mhatre
          wrote on last edited by
          #4

          We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }

          1 Reply Last reply
          0
          • D David Mujica

            Yup. That was exactly what I was going to suggest. I ran into that problem where I had forgotten to close and dispose my SQL connections and the problem didn't show up until I had more people using the system.

            P Offline
            P Offline
            Pratibha Mhatre
            wrote on last edited by
            #5

            We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }

            D 1 Reply Last reply
            0
            • P Pratibha Mhatre

              We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }

              D Offline
              D Offline
              David Mujica
              wrote on last edited by
              #6

              without seeing the code directly, I can't say for sure if that is your problem, but why don't you just code it by hand. (not using the helper). The basic idea is: Open a connection to the database create a SQLcommand which takes parameters Load the parameters while loop(more data to load) execute SQL command load new values in paramters end while close and dispose of connection and command object The idea is that you have made one connection to the database, created one command and loop around the command just changing the parameters. Just a thought. :rose:

              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