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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. A connection pooling error has occurred

A connection pooling error has occurred

Scheduled Pinned Locked Moved ASP.NET
databasehelp
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.
  • S Offline
    S Offline
    SABhatti
    wrote on last edited by
    #1

    Hi everyone, I have class to connect to sql database, this class has some public functions which return datatable, dataset, executeScalar and executeNonQuery. I am using this class in multiple location/functions in the main page. If I initialize (new) this class in page load and does not set to nothing it creates the error (refere to subject for error). And if I initialize it in every function and set it to nothing everytime, it works fine. Can someone tell me the best way to use it, should I initialize and destroy in every calling function or initialize in page load, use it everywhere and let Finalize() to destroy it automatically...:(:-D Salim Akbar

    A 1 Reply Last reply
    0
    • S SABhatti

      Hi everyone, I have class to connect to sql database, this class has some public functions which return datatable, dataset, executeScalar and executeNonQuery. I am using this class in multiple location/functions in the main page. If I initialize (new) this class in page load and does not set to nothing it creates the error (refere to subject for error). And if I initialize it in every function and set it to nothing everytime, it works fine. Can someone tell me the best way to use it, should I initialize and destroy in every calling function or initialize in page load, use it everywhere and let Finalize() to destroy it automatically...:(:-D Salim Akbar

      A Offline
      A Offline
      Andy Marshall
      wrote on last edited by
      #2

      This can be caused by one of two issues; 1 - Your maximum connections have been passed programatically, this is not very common. 2 - The more normal reason is that your close connection + dispose is not being called, this leads to the same sort of error. IMO the best way to handle this is to keep the scope local and ensure correct handling of errors etc guaraantees that your connection is always closed and disposed of when it is no longer needed and then the connections goes out of scope as your function or sub is released to the garbage collector.

      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