Easy "database access" design question

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I've been reading this aeticle:

http://www.developer.com/design/article.php/10925_3347291_2

to get a better grip on OO design and thoughts. On this section of the article, it talks about "a database access class". It has DB open, close, etc.

question: What I've done in my small asp.net/vb.net app is to repeat the conenction string, opening of database, closing it, etc in each subroutine/function

So how can I avoid this reapeating of code..actually build a class to do all the DB stuff as this article suggests? anyone with a good example i could look at it?
 
is this a typical design that more experienced developers follow? what are other options besides what I do and besides having a "database access class" designed?

For example, what would u (and other experienced developers on this forum) suggest?
 
Back
Top