Where to store config settings in Web Service

Discussion in 'ASP .Net' started by Chris Dunaway, Jan 9, 2004.

  1. I have a web service that references a data class library which performs
    SQL Server access. Since the web service is also a class library, there is
    no App.Config, only Web.config. Is Web.Config the place I should store the
    connection string?

    If I call System.Configuration.ConfigurationSettings.AppConfig from the
    data class library, will it read the settings from the web.config or will
    it throw an exception?

    Thanks

    --
    Chris

    To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
    address.
     
    Chris Dunaway, Jan 9, 2004
    #1
    1. Advertising

  2. Chris Dunaway

    Hermit Dave Guest

    Web.config is certainly the place to store information like connection
    string.
    But you need to be careful.... web.config file is not served... but you
    always consider the worst case scenario...
    that someone got hold of your web.config file....

    to prevent a very easy access to you database and the user name and
    passwords to you database... its normally a good practice to encrypt the
    connection string..
    store the encrypted key in web.config file...

    http://www.obviex.com/samples/Encryption.aspx

    have a look at code project as well.. saw an article out there which was
    pretty straight forward.... what i normally do is create a seperate assembly
    which does the encyption...
    and then i obfuscat the assembly using overload and string encryption. that
    way it become a bit more secure...

    --
    Regards,

    HD

    "Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
    news:ls8mryhu9ti.c0r6cd5x2kn2$...
    > I have a web service that references a data class library which performs
    > SQL Server access. Since the web service is also a class library, there

    is
    > no App.Config, only Web.config. Is Web.Config the place I should store

    the
    > connection string?
    >
    > If I call System.Configuration.ConfigurationSettings.AppConfig from the
    > data class library, will it read the settings from the web.config or will
    > it throw an exception?
    >
    > Thanks
    >
    > --
    > Chris
    >
    > To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
    > address.
     
    Hermit Dave, Jan 9, 2004
    #2
    1. Advertising

  3. Chris Dunaway

    Curt_C [MVP] Guest

    Yup

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
    news:ls8mryhu9ti.c0r6cd5x2kn2$...
    > I have a web service that references a data class library which performs
    > SQL Server access. Since the web service is also a class library, there

    is
    > no App.Config, only Web.config. Is Web.Config the place I should store

    the
    > connection string?
    >
    > If I call System.Configuration.ConfigurationSettings.AppConfig from the
    > data class library, will it read the settings from the web.config or will
    > it throw an exception?
    >
    > Thanks
    >
    > --
    > Chris
    >
    > To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
    > address.
     
    Curt_C [MVP], Jan 9, 2004
    #3
    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. Max
    Replies:
    2
    Views:
    462
  2. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=

    Web.Config Get Config settings at runtime.

    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,310
    Kevin Spencer
    Feb 6, 2004
  3. CSharpner
    Replies:
    0
    Views:
    1,129
    CSharpner
    Apr 9, 2007
  4. leeanne
    Replies:
    0
    Views:
    1,931
    leeanne
    Sep 24, 2008
  5. donet programmer
    Replies:
    3
    Views:
    1,640
    Gregory A. Beamer
    Nov 20, 2009
Loading...

Share This Page