Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Where to store config settings in Web Service

Reply
Thread Tools

Where to store config settings in Web Service

 
 
Chris Dunaway
Guest
Posts: n/a
 
      01-09-2004
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.AppConf ig 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.
 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      01-09-2004
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$(E-Mail Removed)...
> 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.AppConf ig 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.



 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      01-09-2004
Yup

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


"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:ls8mryhu9ti.c0r6cd5x2kn2$(E-Mail Removed)...
> 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.AppConf ig 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
Class Library reading web.config Settings OR app.config settings leeanne ASP .Net 0 09-24-2008 05:36 PM
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Web.Config Get Config settings at runtime. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?= ASP .Net 3 02-06-2004 01:17 PM



Advertisments