|
-
Feb 15th, 2006, 12:54 PM
#1
Thread Starter
Frenzied Member
Database connection best practice
Just wondered if I could get a few opinions on the following.
We have just had a new developer start here and he uses a method to connect/disconnect to a database I've never seen before. Basically he sets the database connection as a global object for the page and then opens it in Page_Load and closes it in Page_Unload. As I've not seen this method before I'm presuming it is not best practice.
Obviously this means he only opens one connection and I know that there is a high overhead when opening and closing database connections. However I'm not sure how this would cope with errors.
Is it better to open and close database connections when needed and be able to use using and try/catch statements?
Your thoughts appreciated.
DJ
If I have been helpful please rate my post. If I haven't tell me!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|