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
http://Steve.Orr.net
"Atif Jalal" <ma***@hotmail.com> wrote in message
news:b7**************************@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?