Re: How to share the connection string?

Discussion in 'ASP .Net' started by sloan, Feb 23, 2010.

  1. sloan

    sloan Guest

    PLEASE DO NOT MULTI-POST.

    Answered in the csharp group.

    http://www.lmgtfy.com/?q=Crosspost vs Multipost Newsgroup Etiquette




    "Ele" <> wrote in message
    news:4b83dad1$0$1129$...
    > Hello,
    >
    > I have one solution containing two c# projects: one project builds a DLL
    > that is used by the main project (the other project). In the web.config of
    > the main project I added (in the appSettings section) the connectionString
    > parameter, that I read to load my connection string (to SQL Server 2005).
    >
    > However, in the supporting project (the DLL), sometimes I need to connect
    > to the database too. But I don't have the connection string there, and I
    > don't want to duplicate it (in some constant inside the DLL). Sure, I can
    > pass the connectionString each time I call a method/function in the DLL,
    > but I think this is not a good way.
    >
    > So my question is: what is the best way to share the connectionString
    > between the main project and the DLL?
    >
    > Thanks!
    >
    >
    >
    sloan, Feb 23, 2010
    #1
    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. dollar

    how to share the connection?

    dollar, Apr 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    308
    Kevin Spencer
    Apr 22, 2005
  2. Andy O'Neill

    Re: How to share the connection string?

    Andy O'Neill, Feb 24, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    417
    Andy O'Neill
    Feb 24, 2010
  3. Saraswati lakki
    Replies:
    0
    Views:
    1,322
    Saraswati lakki
    Jan 6, 2012
  4. Jack
    Replies:
    2
    Views:
    214
  5. Eric Wong
    Replies:
    0
    Views:
    202
    Eric Wong
    Feb 13, 2010
Loading...

Share This Page