469,356 Members | 2,553 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Managing many connection strings (ASP.NET 2.0)

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

Jul 21 '06 #1
2 1186
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/ar.../23/16785.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Piotrek" <pt*********@poczta.fmwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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

Jul 21 '06 #2
Thanks Teemu, you helped me a lot.

Piotrek.

Jul 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by peshekeedweller | last post: by
7 posts views Thread by Gary Brizard | last post: by
11 posts views Thread by =?Utf-8?B?UGF0Qg==?= | last post: by
9 posts views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.