Using Connection Class VS Connection Module in Asp.net Application

  • Thread starter Thread starter Dave Johnson
  • Start date Start date
D

Dave Johnson

Working on Asp.net with access database backend,a serious Question in
the Class design phase, for accessing the database;

Which is Better to make a Connection Class that handles all the ADO
Connections for all the other Objects,

OR

Just make a Connection Module to handle the Database Access,

Wondering Which is Better and Why???? please if u have more Experience
in this Kind of "Design Issue" please Help given reasons and technical
info to support the decision,

Thanks

Sharing makes us all Better
 
The System i am Developing is Online Cinema Reservation System that uses
MS Access Database, my Question was Which is better To make a Connection
Module thats is responsible for holding all the data about accessing the
Database such as my ConnectionString,etc. Or to build a Connection Class
thats will Interact with others Objects in my Applications.

thanks ;)


Sharing makes us all Better
 
Dave,

In VS 2005 there is the dbproviderfactory class with that you can use one
config file for all types of DataBaseConnection.

http://msdn2.microsoft.com/en-us/library/system.data.common.dbproviderfactory.aspx

This new options shows in my opinion direct a part of the answer to your
question.

In an ASPNet application I go for setting things like connectionstrings in a
static class. While things as data I will set in a normal class to use as a
database layer in my applications. Be aware that an AspNet applications is
stateless, a client has no persistent data except those in a session or in a
viewstate.

This is just an approach of course, there are not for nothing so many ways
to go in .Net to have one simple "best" solution. for an application of one
page this is senseless to do.

I hope this helps,

Cor
 
Back
Top