Managing many connection strings (ASP.NET 2.0)

P

Piotrek

Hi all.

I am developing a web application, which should be able to retrieve
data from many databases. In Web.Config I created three named
connection strings.

My app consists of DAL, BLL and Presentation Layer. In GUI user shuld
be able to select database, which he wants to work with. I can store
connection string of selected DB in Session, but I have problems with
passing it to DAL through BLL. My BLL classes are normal cs files and
they do not have access to Session. Of course I can pass this.Page
parameter to BLL and then use page.Session, but I find this solution a
bit clumsy.

Does anybody know a better solution to this? I am sure that many of you
faced the same problem as I do, so I would like to know your solutions.

Thanks in advance,
Piotrek
 
T

Teemu Keiski

Hi,

you could have intermediate class used to represent the session (or
settings), perhaps implementing some interface, which you can pass to BLL .
It's right way to do it, so that BLL etc knows anothing about ASP.NET's
session. It can have session concept but that's loose from the session
implementation of the underlying platform.

I've discussed some of it, in a blog post

ASP.NET's Session and business components
http://aspadvice.com/blogs/joteke/archive/2006/04/23/16785.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top