Enterprise Library Configuration setting!

Discussion in 'ASP .Net' started by Rick Mavrovik, Jul 11, 2007.

  1. 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
    Rick Mavrovik, Jul 11, 2007
    #1
    1. Advertising

  2. 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>
    Michael Nemtsev, Jul 11, 2007
    #2
    1. Advertising

  3. 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

    "Michael Nemtsev" <> wrote in message
    news:...
    > 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>
    >
    Rick Mavrovik, Jul 11, 2007
    #3
  4. 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> "Michael Nemtsev" <> wrote in message
    RM> news:...
    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>
    Michael Nemtsev, Jul 11, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. plaztik via DotNetMonster.com

    Enterprise Library - Indirect/Inherited Configuration??

    plaztik via DotNetMonster.com, May 6, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    500
    Scott Allen
    May 6, 2005
  2. Mark
    Replies:
    0
    Views:
    797
  3. Replies:
    3
    Views:
    534
  4. Replies:
    3
    Views:
    386
    Tom Dyess
    Jan 20, 2005
  5. Jess Chadwick
    Replies:
    1
    Views:
    4,753
    Steven Cheng[MSFT]
    Sep 21, 2006
Loading...

Share This Page