/// Frank Hagen: Professional Web Developer, C# User, Reformed Über-geek RSS 2.0
# Thursday, March 01, 2007
I Believe...  that all database connections should be opened immediately before using them and closed immediately afterwards.
 
I Believe...  that if you are going to create a data layer, and you should, and you also create a data access layer, and you should, that the connection.open method be put in the lowest level and handled as abstractly as possible.  Yes the connection.close should be called before returning results.
 
I Believe...  that if you open the connection to the database in a method and pass that connection as a variable to another object, you should be shot.
 
I Believe...  that if you open the connection to the database in a method and pass it as a variable to another object, and forget to close said connection, you should be stabbed.
 
I Believe...  that if you open the connection to the database in a method and pass it as a variable to another object, and store the open connection in an ASP.NET session variable, you should be stabbed in the eye.  Twice.  With a spoon.
 
I Believe...  that if you store the results of a large query in ASP.NET session so you can page it back to the user, they haven't devised a painful enough punishment for you yet.
 
 
With special thanks to Blue Collar TV for the "I Believe..." concept.
Thursday, March 01, 2007 6:27:35 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET | Programming | Rant
All comments require the approval of the site owner before being displayed.
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: b, blockquote@cite, i, strike, strong, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
<%--
--%>
Statistics
Total Posts: 186
This Year: 0
This Month: 0
This Week: 0
Comments: 72
Locations of visitors to this page
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Frank W Hagen
Sign In
All Content © 2010, Frank W Hagen
Custom DasBlog theme based on 'Business' by Christoph De Baene