Enterprise Library Configuration setting!

R

Rick Mavrovik

Hi,
I am developing web application on 3 tier model. For data access my Data
Access Layer (DAL) uses MS Enterprise Library (MSEL). If I am right MSEL
relies on web.config file for the connection strings. I need to make the DAL
totally independent ie I want to save the connection string information in a
App.config file inside the DAL project (a class library project).

How can I make MSEL to use App.Config in DAL for connection string instead
of Web.Config in ASP.Net application??

The reason I want to do this is that I have .Net windows service which need
to use the DAL independently of the application.

-Rick
 
M

Michael Nemtsev

Hello Rick,

your can remove the connection string section from the web.config and put
in to the separate file, which will be refered by web.config and your app.config

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

RM> Hi,
RM> I am developing web application on 3 tier model. For data access my
RM> Data
RM> Access Layer (DAL) uses MS Enterprise Library (MSEL). If I am right
RM> MSEL
RM> relies on web.config file for the connection strings. I need to make
RM> the DAL
RM> totally independent ie I want to save the connection string
RM> information in a
RM> App.config file inside the DAL project (a class library project).
RM> How can I make MSEL to use App.Config in DAL for connection string
RM> instead of Web.Config in ASP.Net application??
RM>
RM> The reason I want to do this is that I have .Net windows service
RM> which need to use the DAL independently of the application.
RM>
RM> -Rick
RM>
 
R

Rick Mavrovik

Hi,
OK....how can I do that...I mean how can I make Web.config to refer to some
other file for connection string.
Thanks
-Rick
 
M

Michael Nemtsev

Hello Rick,

Add <appSettings file="common.config"> into your web.config and put your
connection string into common.config

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

RM> Hi,
RM> OK....how can I do that...I mean how can I make Web.config to refer
RM> to some
RM> other file for connection string.
RM> Thanks
RM> -Rick
RM> RM>
Hello Rick,

your can remove the connection string section from the web.config and
put in to the separate file, which will be refered by web.config and
your app.config

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

RM> Hi,
RM> I am developing web application on 3 tier model. For data access
my
RM> Data
RM> Access Layer (DAL) uses MS Enterprise Library (MSEL). If I am
right
RM> MSEL
RM> relies on web.config file for the connection strings. I need to
make
RM> the DAL
RM> totally independent ie I want to save the connection string
RM> information in a
RM> App.config file inside the DAL project (a class library project).
RM> How can I make MSEL to use App.Config in DAL for connection
string
RM> instead of Web.Config in ASP.Net application??
RM> RM> The reason I want to do this is that I have .Net windows
service
RM> which need to use the DAL independently of the application.
RM> RM> -Rick
RM>
 

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,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top