Sharing DB connection

Discussion in 'ASP .Net' started by David Dvali, Jul 13, 2005.

  1. David Dvali

    David Dvali Guest

    How can I share DB connections between many pages?
    David Dvali, Jul 13, 2005
    #1
    1. Advertising

  2. David Dvali

    Teemu Keiski Guest

    Hi,

    why would you need to? Do you have some sort of transaction which should
    last over multiple pages?

    Anyways, connection pooling in .NET is one reason why you shouldn't try to
    share connections, but instead use them so that open the conn late and close
    as soon as possible and when you need a another conn, instantiate such when
    needed.

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke
    Teemu Keiski, Jul 13, 2005
    #2
    1. Advertising

  3. You should not. This is not your grandfather's ASP. ASP.Net uses Connection
    Pooling to solve the problems that ASP had. With ASP.Net, you should open
    and close Connections as quickly as possible.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    The sun never sets on
    the Kingdom of Heaven

    "David Dvali" <> wrote in message
    news:eSBds$...
    > How can I share DB connections between many pages?
    >
    Kevin Spencer, Jul 13, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Atif Jalal

    Database connection sharing

    Atif Jalal, Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,879
    Steve C. Orr, MCSD
    Aug 8, 2003
  2. janne

    DAOs and Connection sharing

    janne, Jul 30, 2004, in forum: Java
    Replies:
    2
    Views:
    491
    John Fereira
    Jul 31, 2004
  3. Replies:
    1
    Views:
    313
    Daniel Dittmar
    Feb 1, 2006
  4. Mike P2
    Replies:
    4
    Views:
    343
    Eliyahu Goldin
    Jun 3, 2007
  5. patrick boulay
    Replies:
    7
    Views:
    6,750
    PatrickBlais
    Apr 2, 2009
Loading...

Share This Page