F
Frédéric Mayot
Hi,
In my web application, I need to connect to an SQL Server database. My pages
(UI) will use one or more business objects as well as datareaders (I cannot
make everything a business object...)
With ASP 3, I created a VB class named DataAccess which maintained an ADO
Connection object and facilitates the creation of recordsets. One instance
was created at the beginning of the page and a reference was given to the
business objects.
This is not an easy approach because I need to pass the dataacess object to
any object which needs to access the DB. The advantage is that only one
connection is opened by a page. Another advantage was the ability to
retrieve scalars as well as arrays, but this is already done with ADO.NET.
What is your opinion ? With ASP.NET, should I create a new Connection each
time I need to access the DB or should I still encapsulate this ?
Thanks.
Fred
In my web application, I need to connect to an SQL Server database. My pages
(UI) will use one or more business objects as well as datareaders (I cannot
make everything a business object...)
With ASP 3, I created a VB class named DataAccess which maintained an ADO
Connection object and facilitates the creation of recordsets. One instance
was created at the beginning of the page and a reference was given to the
business objects.
This is not an easy approach because I need to pass the dataacess object to
any object which needs to access the DB. The advantage is that only one
connection is opened by a page. Another advantage was the ability to
retrieve scalars as well as arrays, but this is already done with ADO.NET.
What is your opinion ? With ASP.NET, should I create a new Connection each
time I need to access the DB or should I still encapsulate this ?
Thanks.
Fred