DB Connection

  • Thread starter Thread starter Francisco Spaeth
  • Start date Start date
F

Francisco Spaeth

Hello guys...

My guess is where is the best place to store a data base connection?
(application, session, open in the constructor of the page and close in
the destructor, for ever command or group of command open a connection
and then close or ...)?

grateful
Francisco Spaeth
 
Hi Francisco,

In my opinion, it's best to open a new DB connection when you need it and
then close it right away. You reduce the resources used on your DB server,
and with ADO.NET connection pooling, the re-opening of these connections can
be quite fast.
 
Back
Top