Re: Making a database connection global
- From: "sloan" <sloan@xxxxxxxxx>
- Date: Fri, 12 May 2006 17:14:38 -0400
With the web:
Open as late as possible.
Close as quick as possible.
I'd recommend looking into the EnterpriseLibrary (Data esp)
http://www.gotdotnet.com/codegallery/codegallery.aspx?id=295a464a-6072-4e25-94e2-91be63527327
They have already put in alot of best practices.
But regardless, global db connection is a terrible idea.
Pooling is a seperate issue.
I'd recommend
ISBN
159059522X
Expert ASP.NET 2.0 Advanced Application Design
"Terry Jolly" <terry@xxxxxxxxx> wrote in message
news:4464f7d0$0$6150$39cecf19@xxxxxxxxxxxxxxxxxxxxx
Web Solutionand
Goal: Have a global database connection
Why: (There will be 30+ tables, represented by 30+ classes) I only want to
reference the database connection once.
I put the connection string in the web.config.
I created a class with a static database connection and the class opens
closes the database.
This seems to work so the question: Is there a better way to handle the
database connection?
Thanks In Advance.
.
- References:
- Making a database connection global
- From: Terry Jolly
- Making a database connection global
- Prev by Date: Re: Making a database connection global
- Next by Date: Re: Making a database connection global
- Previous by thread: Re: Making a database connection global
- Next by thread: Re: Making a database connection global
- Index(es):
Relevant Pages
|