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. General Programming
  3. C#
  4. Sql Connection...

Sql Connection...

Scheduled Pinned Locked Moved C#
performancehelpdatabasebeta-testingcode-review
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
    ayuba asia
    wrote on last edited by
    #1

    I need a suggestion on opening SQL Connection Is it better for me to open and close the connection on each form that accces the data or i create i static connection that last thourgh to application run time, then close it.. I got a few feedback saying.. some say if i open and close connection each it may effect the performance and some say that if i open and static connection it will cause memory problem.. for ur info currently i doing with 1 static connection.. please give me an explanation on this issue thanks

    C 1 Reply Last reply
    0
    • A ayuba asia

      I need a suggestion on opening SQL Connection Is it better for me to open and close the connection on each form that accces the data or i create i static connection that last thourgh to application run time, then close it.. I got a few feedback saying.. some say if i open and close connection each it may effect the performance and some say that if i open and static connection it will cause memory problem.. for ur info currently i doing with 1 static connection.. please give me an explanation on this issue thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Open and close the connection, .NET maintains it's own connection pool. Christian Graus - Microsoft MVP - C++

      F 1 Reply Last reply
      0
      • C Christian Graus

        Open and close the connection, .NET maintains it's own connection pool. Christian Graus - Microsoft MVP - C++

        F Offline
        F Offline
        flicktom
        wrote on last edited by
        #3

        I was just boning up on the subject last night, and most DBMSs (if not the .NET itself) maintain a connection pool. This way, it can create how ever many connections it will dole out ahead of time, and assign them as needed, instead of performing the resource consuming actions to create them on the fly. Think of it like an old fashioned hotel switchboard operator's console.. they've got a certain number of outside connections all ready to go, but nothing directly connected to the rooms... When you call the operator, they just plug you in when you request an outside line. This is just the reason you "don't" want to use a static connection. Too many applications holding the line when they don't need it could lock up your DBMS for those that do. Flicktom

        A 1 Reply Last reply
        0
        • F flicktom

          I was just boning up on the subject last night, and most DBMSs (if not the .NET itself) maintain a connection pool. This way, it can create how ever many connections it will dole out ahead of time, and assign them as needed, instead of performing the resource consuming actions to create them on the fly. Think of it like an old fashioned hotel switchboard operator's console.. they've got a certain number of outside connections all ready to go, but nothing directly connected to the rooms... When you call the operator, they just plug you in when you request an outside line. This is just the reason you "don't" want to use a static connection. Too many applications holding the line when they don't need it could lock up your DBMS for those that do. Flicktom

          A Offline
          A Offline
          ayuba asia
          wrote on last edited by
          #4

          thanks for the reply

          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