Database connection sharing

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Database connection sharing

    How can I share the sane databse connection between asp.net pages. I
    also use objects(middleware), so can I pass the same DB connection
    when I instantiate the object by calling its constructor?
    Atif Jalal Guest

  2. Similar Questions and Discussions

    1. Internet Connection Sharing
      Can you elaborate on this a bit? What kind of connection are you trying to share? At exacly what point does the error message come up? How are...
    2. Sharing a dial-up connection over a wireless lan
      How do you get network to share a connection from one computer? It shows up on all the computers as connected and when you open any programs that...
    3. Error with Internect Connection Sharing
      occured help I'm not sure if this is the problem but you should check this. Go into computer management (control panel -> administrative tools)...
    4. net connection sharing
      yes I know, ill tell you in December "Sia" <siavash_s_s@hotmail.com> wrote in message news:euldZdT6CHA.2268@TK2MSFTNGP11.phx.gbl... things...
    5. Sharing dial up connection
      I am trying to network 2 xp machines. #1 has a 56k modem, with ICS enabled. #2 sees the connection, but will not dial the modem. This is with MSN,...
  3. #2

    Default Re: Database connection sharing

    This connection sharing is done automatically. ADO.NET has built in
    connection pooling.
    Open your db connection just before you need it, and close it as soon as you
    are done with it.
    As long as you use the same exact connection string everywhere the sharing
    will be automatic - you will not actually open a new database connection
    each time despite what the syntax suggests. The connections will be
    recycled for you.
    Purposely keeping connections open and trying to pass them to other pages
    will result in inefficient, poorly performing code.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Atif Jalal" <matif@hotmail.com> wrote in message
    news:b7af12d4.0308081253.340380d2@posting.google.c om...
    > How can I share the sane databse connection between asp.net pages. I
    > also use objects(middleware), so can I pass the same DB connection
    > when I instantiate the object by calling its constructor?

    Steve C. Orr, MCSD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139